Re: [w3c/ServiceWorker] Scope matching algorithm breaks sites that don't end in a slash (#1272)

@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