Minimal viable service worker
Jeremy, with the help of Jake, has developed a MVP for the service worker. It allows HTML to always be requested from the server, and if there’s an issue it goes to the cache (and adds a new version to the cache each time it visits the network version). It does the same for files, but goes to the cache first before then going to the network if it can’t be found (and even if it is, it goes to the network to refresh the file version). Pretty nifty really, you should trial it out and feedback to Jeremy with any issues or recommendations.
(if you like the sound of this I covered it on the podcast in episode 68)
My original attempt was riddled with errors. Jake came to my rescue and we revised the script into something that actually worked. In the process, my misunderstanding of how
An excerpt from Minimal viable service workerawait
works led Jake to write a great blog post onawait
vsreturn
vsreturn await
.