Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid precaching newer contents for old revisions #3286

Open
soc221b opened this issue Jan 10, 2024 · 0 comments
Open

Avoid precaching newer contents for old revisions #3286

soc221b opened this issue Jan 10, 2024 · 0 comments

Comments

@soc221b
Copy link

soc221b commented Jan 10, 2024

Library Affected:
workbox-sw

Browser & Platform:
Google Chrome 120.0.6099.129

Issue or Feature Request Description:

During deployment, clients can install a service worker and send requests to servers to precache assets.

At this point, the server responds with newer content, and the service worker should not store the content in CacheStorage as it is requesting content for an old revision.

Reproducible repository: https://github.com/iendeavor/workbox-issue-precaching

  1. client visits website and starts to register service worker
  2. service worker performs precaching for {url: 'public/a.js', 'revision': 'version-1.js'}
  3. (deploy new content: content of public/a.js is changed now, new metadata is {url: 'public/a.js', 'revision': 'version-2.js'})
  4. server responds newer content
  5. service worker save newer content for older revision
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

No branches or pull requests

1 participant