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

Update the prefetch SW example to use cache-busting parameters #209

Merged
merged 8 commits into from
Sep 17, 2015

Conversation

jeffposnick
Copy link
Contributor

R: @gauntface @wibblymat @PaulKinlan et al.

The current example showing off a service worker that prefetches URLs and then uses those responses in a cache-first strategy runs the risk of locking users in to a stale response indefinitely. To mitigate this risk, this change appends a cache-busting URL parameter to the fetch() request made in the install handler. That way, we can be assured that the response to that initial request is fresh at the time the install handler is run.

(It's possible that the resource might change after the install handler is run, and coordinating those resource changes with the service worker cache versioning is a separate problem that's already alluded to in the comments.)

@wibblymat
Copy link
Contributor

👍

jeffposnick added a commit that referenced this pull request Sep 17, 2015
Update the prefetch SW example to use cache-busting parameters
@jeffposnick jeffposnick merged commit c27c6d5 into GoogleChrome:gh-pages Sep 17, 2015
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.

2 participants