Re: [w3c/ServiceWorker] Declarative routing (#1373)

A bit late to the party but...

+1 for the "side effect operation" issue raised by @jeffposnick and @nhoizey

In addition to refreshing the cache based on a network source, firing analytics beacons is another  feature that would be heavily used by LinkedIn. We have a lot of instrumentation to measure how the service worker is working/not working. The highest priority V2 feature for us would be support for a `routingcomplete` or similar event, to handle both of these cases.

@jakearchibald 
> I think I'd make this an option to RouterSourceNetwork, as it's the only one that would benefit from a timeout right now.

I think the timeout feature would be useful for `RouterSourceFetch`, as it might address https://github.com/w3c/ServiceWorker/issues/1292.


Timeout support would be really nice for creating a global fallback "catch all" handler.
```
router.get(
 new RouterIfURLStarts(‘/profile/*‘),
 [new RouterSourceCache(), new RouterSourceNetwork({ timeout: 10000 })]
);

router.get(‘*’, new RouterSourceCache(‘/oops.html’))
```

-- 
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/1373#issuecomment-458156138

Received on Monday, 28 January 2019 14:38:24 UTC