Service worker lifecycle

this video
minute 2:55

When the browser refetches a service
worker looking for updates

When does the browser re-fetch a service worker?
a. On any regular page refresh? or…
b. upon leaving to a different page outside of the sw scope and then returning

it will go through the browser cache
as pretty much all requests do.

Does he mean that the service worker will at this point intercept the requests from the browser to the server for resources and then in turn respond with cached resources?
I did not understand what hes trying to say w the above statement.

Because of this I strongly recommend
keeping a cache time on your service workers short.


I don’t have a technical answer for this but to refresh my service-worker I close all relevant tabs, and then open a new tab.

This usually refreshes the service-worker but it also can require a hard refresh ctrl + f5 after reloading the application in a new tab.