4

What do I need to do to force a web assembly Blazor application stored on an Azure static web site to refresh when a new version is uploaded (through GitHub)?

I am seeing conflicting and possibly outdated information: first this which does not do the trick for me.

Next this which seems to imply I need to add a second service-worker in addition to service-worker.published.js. Is that the case?

***Edit: I have added the following line at the top of service-worker.published.js and keep changing the number, with no effect.

const CACHE_VERSION = 0.822;

I'm sure it is a simple solution - which should really be the default by the way...

GilShalit
  • 6,175
  • 9
  • 47
  • 68
  • 1
    Not exactly an answer to your question, but I did find that changing the cache_version doesn't immediately trigger a new version. From what I noticed on the first load after the new version has deployed (and you change your version number) the browser should recognize that a new service-worker is available. At this point, it hasn't refreshed anything yet. After closing the browser and opening the page again it should use the new version. This isn't a great option, so I do hope someone comes up with a better way. – Nijenhof Apr 01 '21 at 16:11

0 Answers0