We're building a blazor webassembly client (also installable as PWA) which is hosted on Azure AppService. We keep getting old verions of the app after publish.
Even when I hit CTRL-SHIFT-R to competely reload the site, after I close and open the link againI get the old version again.
I set the WEBSITE_LOCAL_CACHE_OPTION = Never on the AppService but that didn't help.
If you created a PWA the service worker is responsible for caching the assets. Look at the code to see why it’s not updating. It probably stores the webassemply in local storage. You can use the the browser to clear local storage for your site, to see if
it’s the issue.
Member
1 Points
2 Posts
Keep getting old version of Blazor Webassembly project after publish
Jul 11, 2020 09:38 AM|gjvdkamp|LINK
Hi,
We're building a blazor webassembly client (also installable as PWA) which is hosted on Azure AppService. We keep getting old verions of the app after publish.
Even when I hit CTRL-SHIFT-R to competely reload the site, after I close and open the link againI get the old version again.
I set the WEBSITE_LOCAL_CACHE_OPTION = Never on the AppService but that didn't help.
Do you have any guidance on how to prevent this?
Gert-Jan
All-Star
58474 Points
15788 Posts
Re: Keep getting old version of Blazor Webassembly project after publish
Jul 11, 2020 03:56 PM|bruce (sqlwork.com)|LINK
If you created a PWA the service worker is responsible for caching the assets. Look at the code to see why it’s not updating. It probably stores the webassemply in local storage. You can use the the browser to clear local storage for your site, to see if it’s the issue.
Member
1 Points
2 Posts
Re: Keep getting old version of Blazor Webassembly project after publish
Jul 14, 2020 01:22 PM|gjvdkamp|LINK
Indeed updating the service worker helped, especially these two docs:
https://docs.microsoft.com/nl-nl/aspnet/core/blazor/progressive-web-app?view=aspnetcore-3.1&tabs=visual-studio#control-asset-caching
https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#skip_the_waiting_phase