I have a website which has a service worker like:
// Import a script from another domain
importScripts('https://example.com/script.js')
Suppose that script.js
is updated with some new code and the service worker is activated due to a push event (the user is the meantime has not visited my website again).
Does importScripts
checks for updates each time the service worker is activated or it downloads the script.js
just once when the service worker is first installed?
Is there any way to have the service worker code (and in particular the imported scripts) refreshed each time the service worker receives a push message?