- From: Jake Archibald <notifications@github.com>
- Date: Wed, 14 Feb 2018 08:12:58 -0800
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 14 February 2018 16:14:31 UTC
@davidcblack > When we install a SW and give it a cache expry date does it automatically unregister from its scopes once its cache TTL expires? Nah, your service worker registration lasts, in theory, forever. Taking the example where a SW has scopes `/` and `/login/`, and a new SW wants to control `/login/`, you could, on visit to `/login/`: 1. Let reg be the registration with a scope matching `/login/`. 1. If reg is not null, re-register reg with the same url & settings, but without the `/login/` scope. 1. Register the new service worker for `/login/`. You'd need to update the register call for the `/` SW, and be aware that this will reject until you do so. This is pretty hard, and it'll behave differently depending on which step happens first, so the issue may not be caught until things go live. It seems more risky, and requires more inter-app awareness than the blank service worker idea I posted earlier. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/ServiceWorker/issues/1272#issuecomment-365657349
Received on Wednesday, 14 February 2018 16:14:31 UTC