How can I make sure that the users of a Blazor client app always load the latest version of the code? I now have to instruct them to clear their browser caches every time a new version is published. This hampers the "release early and often" approach and I simply cannot believe that any serious blazor development is at all possible without checking for new versions at start up (what click once applications do).
I found this solution on https://learn.microsoft.com/en-us/answers/questions/214424/blazor-wpa-not-updating.html
/**
* Register Service Worker
*/
navigator.serviceWorker
.register('/***.js', { scope: '/' })
.then(() => {
console.log('Service Worker Registered');
});
This js file can contain a cache version like below.
const CACHE_VERSION = 1.0
But that is too cryptic for me? How can I implement the solution stated above as in "for dummies"?