DEV Community

Discussion on: Handling Service Worker updates in your Vue PWA

Collapse
 
ajlozier profile image
Aaron Lozier

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
    }
Enter fullscreen mode Exit fullscreen mode
Collapse
 
frynt profile image
frynt

This works perfectly ! thanks !