Queries around deleting cache, unregistring SW and offline feature #147
Unanswered
maverickdude
asked this question in
Q&A
Replies: 1 comment 3 replies
-
@DuCanhGH Could you please help me with above queries? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a few queries. Service workers are new to me and thus I need help answers on a few queries.
Query 1:
In my app, viewing cached pages works fine when offline.
Also, the offline page is showing fine on navigating to any uncached route (except homepage) when offline.
But as soon as the offline page has been shown, going back to homepage and then any previously cached page will show offline page only. I'm not sure if it's the expected behaviour.
Apologies for not sharing a minimal reproduction example at the moment.
Query 2: How to unregister service-worker for all users?
I found a way to do it here. But is there a config based way or a better way to do this?
Query 3: How to clear existing Workbox cache after unregistering service-worker?
From above link I tried to unregister SW and it worked. But when checking in Chrome devtools, it still sometimes showed the active SW. When I reload the page then the SW shows as deleted.
Also, after unregistering, it still showed the cached pages when offline. Is this the expected behaviour?
If yes, do I need to remove the Workbox cache seperately?
Btw, I found a way to remove cache here. Is this right?
Query 4: How to opt-out from offline feature?
If I had previously enabled offline feature but later want to keep the PWA but disable the offline feature and unregister SW, is that possible?
Sorry I couldn't find the related docs.
My
next.config.js
Beta Was this translation helpful? Give feedback.
All reactions