perf(page): analytics.flisk.si landing page is sent with no-store, so the 4 KB static page is never cached

Open Beginner friendly
#10 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript

Research direction

Start by running the curl -sI https://analytics.flisk.si/ command in the issue to see the cache-control: no-store header, then find the Worker's fetch handler where that blanket header is applied to every response. Branch the header by route so only the landing page gets a public max-age plus an ETag, and add tests for the landing page, the If-None-Match 304 path, and stats/API staying no-store. Done means all three acceptance checks pass and the existing test suite is still green.

Written by the indexing model from the issue text.

Description

agents area: runtime automation chore cli consistency dependencies developer-experience difficulty: easy documentation enhancement good first issue help wanted hygiene json-output priority: P3 starters tests

Problem

The analytics.flisk.si landing page is a small static page (4,295 bytes compressed) but is sent with Cache-Control: no-store. Browsers and the edge can never reuse it, so every visit downloads it again and no 304 is possible.

Reproduce:

  1. Run curl -sI https://analytics.flisk.si/ | grep -i cache-control.
  2. It prints cache-control: no-store.
  3. Compare with host.flisk.si and fleet.flisk.si, which send public, max-age=300.

Expected: a short public cache rule (for example 300 seconds) with an ETag for the static landing page, and no-store only on responses that carry per-user data.

Root Cause Analysis

One blanket no-store rule is applied to every response from the Worker, including the static landing page. The rule was probably meant for the stats and API responses, which are per-site and private.

TDD Fix Plan

  1. RED: Write a test that the landing page response has a public cache rule and an ETag.
    GREEN: Set the cache header on the landing route only.

  2. RED: Write a test that a conditional request with the same ETag returns 304.
    GREEN: Compare the ETag and return 304.

  3. RED: Write a test that stats and API responses still send no-store.
    GREEN: Keep the blanket rule for those routes.

REFACTOR: Move cache rules into a small per-route table.

Acceptance Criteria

  • Landing page sends a public max-age rule and an ETag
  • A repeat request with If-None-Match returns 304
  • Stats and API responses still send no-store
  • All new tests pass
  • Existing tests still pass
Dominant language
JavaScript
Stars
0
Forks
2
Avg merge
1h 33m
Merged PRs (30d)
7

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from flisk-sh/analytics

All issues in flisk-sh/analytics

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.