0
votes

In this docs, I found this snippet:

After the activation step, the service worker will control all pages that fall under its scope, though the page that registered the service worker for the first time won't be controlled until it's loaded again.

I don't think I quite understand this sentence. For me, it seems to mean that:

  • When the user requests a page, the browser always checks for new service worker (bypassing any cache).
  • If a new service worker is present - install it and activate it.
  • Wait for the user to reload the page for the new service worker to take charge.

It doesn't make sense to me. Why make a new service worker take charge only when the user restarts the page, why not make him a primary service worker right away?

1
redfin.engineering/… good background on SW refresh. its more complex than u think - Robert Rowntree

1 Answers

1
votes

Because of consistency as explained in https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#activate I interpret it as : your user may be filling a form. You don't want the page to change behavior in the middle of his action.