Skip to content

bug: the service worker is served with no-store, so installed apps pick up a release right away - #911

Open
lukepolo wants to merge 1 commit into
mainfrom
bug/service-worker-no-store
Open

lukepolo wants to merge 1 commit into
mainfrom
bug/service-worker-no-store

Conversation

@lukepolo

Copy link
Copy Markdown
Contributor

The service worker and its push script are sent with Cache-Control: no-store, so Cloudflare stops caching them and installed apps get a release right away instead of up to 4 hours later.

  • Nitro route rules add no-store to /sw.js and /sw-push.js; the rules run ahead of the static file handler, so they reach public files too
  • no-store rather than no-cache/max-age=0: Cloudflare still keeps those at the edge and raises a short max-age to its 4-hour browser TTL
  • Hashed /_nuxt/ assets and workbox-*.js keep their caching
  • A spec checks that every script the PWA config names (the worker and its importScripts) has a no-store rule

From DEAFCS: DEAFCS/deafcs-web@9d9cab9

…ck up a release right away instead of up to 4 hours later
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant