C
C#2y ago
khamas

❔ Blazor WASM PWA clear all cache and update application

My app does not update automatically on new versions (I use WASM). Since it's PWA the no-cache header does not do anything... Is there a way with JS to clear all files locally or is the service worker able to update files? if so then how? Thanks
17 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
khamas
khamas2y ago
@Hisme if you don't mind we could continue here So how would I set up my service worker to auto update
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
khamas
khamas2y ago
ah I see @Hisme , so if I update the comment on the service worker it will update the next time you load the browser. Is there a way to clear cache via JS interop?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
khamas
khamas2y ago
what is the function to clear it? I can do version control via C#
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
khamas
khamas2y ago
I had tried that in the past but the cache would not get cleared
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
khamas
khamas2y ago
so if I have the new service worker version flag then location.reload(true) will actually clear the cache?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
khamas
khamas2y ago
ah ok
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
khamas
khamas2y ago
what if I have a no-cache header, will it auto update the SW? I use nginx to serve it
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
khamas
khamas2y ago
uhm sure we could call sent you a friend request
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.