Don't forget to hash assets & update references everywhere (including sw.js
).
However sw.js
file name shouldn't be hashed.
Code given in common.js
can be included in your main js
file or inlined in your page.
Inspiration : https://jakearchibald.com/2016/caching-best-practices/
Currently investigating with OVH CDN cache because sw.js
update isn't always triggered.
If your service worker doesn't reflect last version of your website, current solution is to empty CDN cache