Changeset e2ea5c4 in Klonkt for src/services/CryptoBox.js

Timestamp:
07/21/2026 03:55:26 AM (7 weeks ago)
Author:
Robin <roboburr@…>
Branches:
main
Children:
fb30b5d
Parents:
f574435
git-author:
Robin <roboburr@…> (07/21/2026 03:55:23 AM)
git-committer:
Robin <roboburr@…> (07/21/2026 03:55:26 AM)
Message:

Fix: online visitors always get the fresh site, never a cached copy

The service worker was already network-first, but two gaps let a stale page
through while online:

  • the SW's navigation fetch used the browser HTTP cache, so it could return a heuristically-cached page even though it "fetched",
  • full HTML pages carried no Cache-Control, so the browser was free to cache them heuristically.

Now the SW fetches navigations with { cache: 'no-store' } (straight to the
network, cache is only the offline .catch fallback), and renderPage sends
Cache-Control: no-cache on full pages (revalidate; still bfcache-friendly,
partials stay no-store). Verified live: /sw.js uses no-store and GET / returns
Cache-Control: no-cache. Bumped the SW cache name v17 -> v18.

Changed files:
src/server.js

  • sw.js navigation fetch uses { cache: 'no-store' }; cache name v18

src/middleware/render.js

  • full HTML pages get Cache-Control: no-cache (partials stay no-store)

-robo
Co-Authored-By: Claude Opus 4.8 <noreply@…>

(No files)

Note: See TracChangeset for help on using the changeset viewer.