fix: Avoid changing the URL of the service worker.#18
fix: Avoid changing the URL of the service worker.#18bmeurer wants to merge 1 commit intolavas-project:masterfrom
Conversation
According to the official documentation[1], it's bad practice to change the URL of the service worker. Also there's not really a point in having time stamped URLs for the sw-register.js script. This also allows to simplify the registration quite a bit, leading to less JavaScript to parse and execute for the browser. [1] https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle
|
The original intention of The URL of If you can set |
|
But why do you want to disable caching? That way you loose the benefits of caching for both |
|
If don't disable caching of |
|
I see, thanks. |
|
The The problem with changing the URL is it treats it as a new service worker even if nothing's changed. |
|
@jakearchibald Thanks. I didn't notice that this problem has been fixed since Chrome 68. I created a new issue #19, and I'll remove |
According to the official documentation[1], it's bad practice to change
the URL of the service worker. Also there's not really a point in having
time stamped URLs for the sw-register.js script. This also allows to
simplify the registration quite a bit, leading to less JavaScript to
parse and execute for the browser.
[1] https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle