Files
R0ckandClaude Opus 5 3bca909b8c fix(nginx): don't let browsers cache index.html — it is a module manifest
Splitting the front end into ~20 files turned index.html into a versioned
artifact: it lists every JS and CSS file the app loads, in order. nginx sent
Cache-Control: no-cache for .js and .wasm but nothing for HTML, so browsers
applied their own heuristic freshness and held the old one.

Fresh JS against a stale manifest means app.js calls window.MapResponsive.init
— a file that manifest never loads. Blank map, "–" counts, no visible error.
It broke production for every returning visitor until they hard-refreshed,
while a fresh browser (and every headless check) saw a working site, because a
fresh browser has no cache to be stale.

The regex block cannot cover it on its own: "/" does not end in .html. So the
header goes on the root location too, and .css joins the regex since the
stylesheet is split now as well.

no-cache, not no-store: nginx still answers 304 when nothing changed, so this
costs a round-trip rather than a re-download.

The assumption that broke was mine — that index.html was a page rather than a
manifest. Splitting the front end silently made the cache policy load-bearing,
and I did not check it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012LgDv2uN7V4qCDWVXM5e5w
2026-08-02 19:16:50 +01:00
..