You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I've noticed that github pages caches the sw.js with a Cache-Control:max-age=600.
If you visit the app, and refresh the page, this cache will be extended by another 10 minutes, so if you refresh again and again every minute, the app will never update (it's always serving the cached service worker with a refreshed max-age).
I followed the guide and it does update if you leave the page open for 10+ minutes, but I can't see a way right now for forcing the SW to uncache itself.
OfflinePluginRuntime.install({
onUpdating: () => {
console.log('SW Event:', 'onUpdating');
},
onUpdateReady: () => {
console.log('SW Event:', 'onUpdateReady');
// Tells to new SW to take control immediately
OfflinePluginRuntime.applyUpdate();
},
onUpdated: () => {
console.log('SW Event:', 'onUpdated');
// Reload the webpage to load into the new version
if (window.confirm('A new version of the app has been pushed. Would you like to reload?')) {
window.location.reload();
}
},
onUpdateFailed: () => {
console.log('SW Event:', 'onUpdateFailed');
}
});
The text was updated successfully, but these errors were encountered:
There is a spec being developed to solve that, but it isn't implemented anywhere yet. Also it of course won't affect browser which have ServiceWorker implemented already without that feature. So the best way to solve it is to never cache the ServiceWorker file .
Hi, I've noticed that github pages caches the
sw.js
with aCache-Control:max-age=600
.If you visit the app, and refresh the page, this cache will be extended by another 10 minutes, so if you refresh again and again every minute, the app will never update (it's always serving the cached service worker with a refreshed max-age).
I followed the guide and it does update if you leave the page open for 10+ minutes, but I can't see a way right now for forcing the SW to uncache itself.
See facebook/create-react-app#2554 SWI3
Current Config:
The text was updated successfully, but these errors were encountered: