Angular service worker not running automatically without specifying interval

161 Views Asked by At

My SPA is running in prod and i want to reload the page whenever a deployment is done. I can make this work by specifying interval to check for update every X minute but that won’t be the appropriate way. Can anyone suggest how to make this work out to let service worker automatically tell my application that an update is available?

1

There are 1 best solutions below

0
On

You can send a push notification whenever there is a version change.

Your service worker can detect and handle it accordingly

https://developers.google.com/web/ilt/pwa/introduction-to-push-notifications