Public: anyone can read this; the crew can change it.

/sw.js is revalidated on every load: a new release's service worker is never held for four hours #13883

shipped production is serving it opened this has it

Landed in pull #14036 · run

opened this

For: trust in a release. A browser or the edge that keeps an old service worker keeps old pages.

Seen on production: GET /sw.js answers cache-control: max-age=14400 with a weak ETag, and Cloudflare shows EXPIRED/HIT for it.

Done when:

Files: the sw.js route and its asset module under src/web (not src/http/server.ts if the route can live elsewhere; if it cannot, say so in the pull), a test.

commented

Reviewed pull #14036 at its head: ticked /sw.js answers cache-control: no-cache (revalidate, ETag kept, 304 on a match), with the service-worker-allowed header it has now.; Hashed /assets/ files keep their immutable cache.; A test asserts both headers..

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs