- From: Iain Shorter <notifications@github.com>
- Date: Mon, 07 Jan 2019 10:20:27 -0800
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Monday, 7 January 2019 18:20:49 UTC
Really liking the concept of avoiding the overhead of starting the ServiceWorker where possible, but I feel like not adding an additional Source type that utilises a callback is a missed opportunity. It would effectively be the same behaviour as the fetch event fallback, but specific to the given conditions. For all other source types we would still avoid starting up the service worker. Also I think syntax wise I feel it reads better to have static methods on a RouterCondition/RouterSource class that instantiate the specific type. Although I'm not sure how in keeping that is with other web APIs. ```javascript const { router } = e; router.get( RouterCondition.startsWith("/avatars/"), [ RouterSource.cache(), RouterSource.network() ] ); router.get( RouterCondition.fileExtension(".mp4"), RouterSource.network() ); router.get( RouterCondition.URL("/"), RouterSource.cache("/shell.html") ); router.add( RouterCondition.any(), RouterSource.custom(fetchEvent => { }) ); ``` -- 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-452030693
Received on Monday, 7 January 2019 18:20:49 UTC