Re: [slightlyoff/ServiceWorker] Enabling multiple Service Workers for a single scope (#921)

> Also, IIUC, I'd have to override these values on each fetch call, as I can't rely on the SW state to remain intact between events. Is that correct?

If you tell your client's to put an `import("awesomeCDNWrapper.js")` at the top of their service worker script it will get evaluated each time the service worker starts up.  I think that should get the wrappers defined.

You would need to manage state in IDB or Cache API, though.  That would be the case no matter how we do this, though.

Long term I think the routing API @jakearchibald is talking about over in #920 could probably encompass this use case as well.  In addition to falling back from fetch or cache to the service worker, we could add the ability to fallback from one service worker event handler to the next.

I'm still not sure we should implement this system yet, though.  It would be a big new high level feature and we're still just getting the underlying primitives out now.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/921#issuecomment-231382126

Received on Friday, 8 July 2016 14:58:09 UTC