-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Invalidate cache by service worker #3665
Comments
It's possible to add a callback with a refresh (or notification with refresh button) after app has been updated, see my #3375 |
Any progress on this? I've been snagged by this issue thinking it was an nginx issue but it wasn't and I'm not a fan of telling my users to reload twice to see the newest updates. |
Nevermind, found out I can opt out of service worker caching in the read me. |
cc @jeffposnick |
If #2426 were merged, it would add a standard way of prompting users to reload whenever there's an updated to a precached resource. If you wanted to "take matters into your own hands", and automatically force a refresh whenever there's updates to precached resources, you could modify the code at https://github.com/facebookincubator/create-react-app/blob/72b6eb8c3c65e6ed0f2413708069287311a386c2/packages/react-scripts/template/src/registerServiceWorker.js#L63-L69 and replace the |
Perhaps an extra optional parameter (taking constants exported from
Also, is it possible to insert metadata to the updated content to inform the service worker on what action to take for that particular update? Perhaps another Eg. I could insert a |
Some of that feedback would be best directed towards #2426, which would need to be updated to match what you describe. Regarding passing along additional information about which URLs were updated, that's unfortunately not something that's exposed in the current, |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs. |
Supposed you have an important update, is there a way to invalidate the cache so that users will see the update on next visit instead of the next + 1 visit?
Is it technically possible to force an automatic browser refresh if the service worker detected that resources are updated, instead of waiting until the next visit to display them?
The text was updated successfully, but these errors were encountered: