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
"When the user clicks the "refresh" button when onNeedRefresh is called, then calls updateSW() function; the page will reload, and the up-to-date content will be served."
Yes, this works, but all the assets are loaded from the network even though the service worker has cached them all. This makes the application feel sluggish after each update. When you first open the app, the service worker immediately goes to work, and all assets are correctly cached. But the caching breaks when updateSW() is called. Is this a bug am I missing out on something?
My JS code is identical to the example given in the documentation.
constupdateSW=registerSW({immediate: true,// Shows UPDATE button in the top toolbaronNeedRefresh(){Bus.$emit('show-reload');},onRegisteredSW(swUrl,registered){registered&&setInterval(async()=>{if(!(!registered.installing&&navigator))returnif(('connection'innavigator)&&!navigator.onLine)returnconstresp=awaitfetch(swUrl,{cache: 'no-store',headers: {'cache': 'no-store','cache-control': 'no-cache',},})if(resp?.status===200){awaitregistered.update();}},intervalMS)},})// When user click on the update button we will execute updateSW() that// activate the new SW reloads pre-cache + reloads the pageBus.$on('update-approved',()=>{updateSW();});
The text was updated successfully, but these errors were encountered:
According to the manual:
"When the user clicks the "refresh" button when onNeedRefresh is called, then calls updateSW() function; the page will reload, and the up-to-date content will be served."
Yes, this works, but all the assets are loaded from the network even though the service worker has cached them all. This makes the application feel sluggish after each update. When you first open the app, the service worker immediately goes to work, and all assets are correctly cached. But the caching breaks when updateSW() is called. Is this a bug am I missing out on something?
My JS code is identical to the example given in the documentation.
The text was updated successfully, but these errors were encountered: