stuff i wish i had known earlier about service workers

  1. Reloading the page doesn’t bahave as you expected
  2. You can access cache API in the browser

Reloading the page doesn’t bahave as you expected

Simply refreshing the page is not sufficient to transfer contro to a new service worker, because the new page will be requested before the current page is unloaded, and there won’t be a time when the old service worker is not in use.

You can access cache API in the browser

You can also use Cache API in your main javascript files, not just in the service worker.