Fix a broken service worker cache

If you deploy a service worker that caches a broken copy of your site, you can cause problems for your users.

The users are stuck on the cached site until you deploy an updated service worker that can clear (or fix) the cache.

The fix: Deploy a new service worker to the same path that deletes the cache storage and doesn't implement fetch handlers.

Open your browsers developer tools. Refresh the page multiple times and you should see alternating broken and working versions of the site.

Look at the cache clearing source.

Made by @abraham and @pblatteier with Glitch!