owencm
owencm

Reputation: 8874

When is my service worker updated?

I can't seem to find in any documentation when my service worker will be updated?

Does it check for a new service worker file every time it is started, or once per day, or something else?

Upvotes: 3

Views: 167

Answers (1)

Marco Castelluccio
Marco Castelluccio

Reputation: 10782

By default it's checked every time the page is opened (https://github.com/slightlyoff/ServiceWorker/blob/master/explainer.md#updating-a-serviceworker).

You can force a check with the ServiceWorkerRegistration.update method, that bypasses the HTTP cache if the previous check was more than one day ago.

Upvotes: 5

Related Questions