[w3c/ServiceWorker] support efficient offline redirects (#1457)

From talking with a number of sites it seems we don't currently have a great way of handling offline redirects.  In this use case a site may have

  vanity.com => (redirect to) => actual.com

If actual.com uses a service worker to provide offline support it has no way to make the vanity.com redirect function offline.

Of course, it is possible to register a service worker on vanity.com with a FetchEvent handler that provides the offline redirect, but that is very heavyweight.  It not only requires spinning up a worker thread to handle the event, but in browsers that implement site isolation it also requires creating a new process.

You can further extend this because some sites I've talked to actually have multiple redirects in a chain they have to deal with.

A comprehensive declarative API like proposed in #1373 would be one way to solve this.  It would allow the service worker on vanity.com to declare the redirect without requiring a FetchEvent to be fired.

I also wonder if there is some way to address this in a smaller API via something like #1454.

I wanted to file this as a separate issue, though, just to get the use case on people's minds.

-- 
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/1457

Received on Tuesday, 13 August 2019 19:38:31 UTC