-
Notifications
You must be signed in to change notification settings - Fork 830
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
If service worker cache update fails halfway through, app is bricked #1316
Comments
Few things to note:
That being said, it would be good to safe guard for this. Ideally, we'd cache requests into a temp cache and rename it in activate, but I don't believe we can rename a cache, but maybe we can read our a re-write the cached requests, but that feels slightly OTT. @jeffposnick any ideas? |
@rjsteinert, just to clarify, which type of cache update are you talking about? Updates to precached resources, or updates to resources that are cached via If you're talking about updates to precached resources, I'm assuming that your resources don't have hash fingerprints as part of their URLs, and you end up overwriting previously cached entries by virtue of sharing the same URL? |
@jeffposnick This can occur if the URLs are the same, but have different revisions. |
Temp cache is best solution maybe because it also you to pre-order update clients before your new server service is up. |
Some historical precedent:
We're not going to go back to Here are some other options:
|
That's correct. If an update fails, some of the cache has been updated but the rest is not. This is particularly problematic in a situation where you have packed your application into chunks but the network cuts out and you end up with an outdated chunk. We ended up going with a solution where updates are never at the same URL. The app moves around according a generated UUID on every release. If the update successfully downloads, remove everything in the cache that doesn't have that new release UUID. This is a higher level complexity than we were hoping to have to support in order to get atomic updates. It would be great if we could pull it off with workbox! |
Just to close the loop here - v3.0.0-beta.2 now uses temp cache. |
Sounds promising @gauntface and @jeffposnick! Thanks so much. |
Library Affected:
workbox-sw, workbox-build, etc.
Browser & Platform:
E.g. Google Chrome v51.0.1 for Android, or "all browsers".
Issue or Feature Request Description:
When updating an app and the network cuts out halfway through, you end up with a bricked app where some files have been updated but others have not. It would be preferable to fallback to the previous version.
The text was updated successfully, but these errors were encountered: