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
{{ message }}
This repository was archived by the owner on Nov 20, 2019. It is now read-only.
Hello
I could really use some advice about initializing the service worker cache logic.
Right now the service worker installs and activates nicely when I clean the cache manually in browser.
But after the first installation the service worker always loads the first installed files. const { assets } = global.serviceWorkerOption; << Shows the most updated assets but it does not serve them.
And I deploy the SW in index.js : if (process.env.NODE_ENV === "production" && 'serviceWorker' in navigator) { const runtime = require('serviceworker-webpack-plugin/lib/runtime'); const registration = runtime.register(); }
Hey, thanks. I got a lot of new information from there yes. And it seems to be working about fine, when closing the tab it mostly updates to new information(not always though).
But about deleting old caches, when new content is fetched.
The service worker logs that [SW] Deleting caches with cache name [ ${cacheName}]
But when I look in the application tab, what I would expect is only 1MB cached, as my bundle is about 1MB. But after I have deployed like 2-3 versions without cleaning cache, it shows 2-3MB.
Any ideas about where to start debugging this ?
Hello
I could really use some advice about initializing the service worker cache logic.
Right now the service worker installs and activates nicely when I clean the cache manually in browser.
But after the first installation the service worker always loads the first installed files.
const { assets } = global.serviceWorkerOption;
<< Shows the most updated assets but it does not serve them.And I deploy the SW in index.js :
if (process.env.NODE_ENV === "production" && 'serviceWorker' in navigator) { const runtime = require('serviceworker-webpack-plugin/lib/runtime'); const registration = runtime.register(); }
My sw.js is pretty much a copy-paste from the docs:
https://paste.ofcode.org/aTrM9Z98ruHCfRdFrn8866
Thanks in advance for any feedback
The text was updated successfully, but these errors were encountered: