Why does service worker fail after a hard reload (Ctrl-Shift-R)?
---- case 1 CHROME --- success
---- case 2 CHROME --- failure
When you shift-reload, the reloaded page will not be controlled by a service worker. This is part of the service worker specification.
This just applies for that next page load. Future page loads (that don't involve shift-reload) will continue to be controlled by a service worker, assuming that the page is in scope of one.
During development you can use, for example, Chrome's Dev-Tools and set that the service workers are updated on each reload:
For further reference you can read Googles Web Essentials on this topic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With