Open deltaepsilon opened 8 years ago
Under the hood, the <platinum-sw-import-script>
element doesn't do very much beyond collecting all the href
values into an array and passing them in as a parameter to the WorkerGlobalScope.importScripts()
method.
The requests to load the scripts listed in importScripts()
obey standard HTTP caching semantics, so unless you explicitly disable HTTP caching with something like a Cache-Control:
response header, the next time the script is imported, it may go against the HTTP cache. Although when that does happen, you should still see a corresponding request made in the Network tab.
If you're not seeing a request made at all, then perhaps your service worker kept running in between the updates you made to your sw-alerts.js
script. The importScripts()
call only happens when the service worker first starts up, and I believe it won't be killed automatically in Chrome as long as you have the DevTools open. You can try explicitly stopping the service worker using that "Stop" icon in the Resources tab and then ensure that you see a request in the Network tab for sw-alerts.js
once you reload your page.
The following code isn't detecting changes to
/sw-alerts.js
. The installs are working great—thanks to the Chrome team for the new Service Workers tab under /Resources!!!—but I'm concerned that my updates won't propagate to end users.I'm not seeing any requests for
/sw-alerts.js
in the Network tab.Removing the element solves my issue for my dev environment... but is this intended behavior?