Thank you for this wonderful article. This is working fine if we refresh the page and showing an update prompt. But this not working without a refreshing page. Especially in the case of SPA. Please help me to show update prompt without refresh page
I had the same question. Turns out you can create an interval to poll for updates in registerServiceWorker.js:
registered(registration) {
console.log(
'Service worker has been registered and now polling for updates.'
)
setInterval(() => {
registration.update()
}, 5000) // every 5 seconds
}
Thank you for this wonderful article. This is working fine if we refresh the page and showing an update prompt. But this not working without a refreshing page. Especially in the case of SPA. Please help me to show update prompt without refresh page
I had the same question. Turns out you can create an interval to poll for updates in
registerServiceWorker.js
:This works perfectly ! thanks !