[ServiceWorker] Proposal: Optimized No-Fetch Service Workers (#718)

Hey all-

In Blink, main resource fetch with a cold Service Worker causes sadness (median Android/470 and Linux/210 ms), even if the worker doesn't intercept requests. To reduce this a bit, I've been looking into a) detecting Service Workers without `fetch` event handlers, and b) immediately falling back to the network. Unfortunately, as things stand today, `fetch` event handlers can be registered at any point, making (a) rather difficult.

A discussion in #195 about `install` and `activate` ended up with a devtools warning, but it seems (naively) like that has less of a performance impact. Does this warrant more harsh restrictions in `fetch`? We're mainly worried about i) non-deterministic registration for a given SW version, and ii) registration after the end of `install`.

(I've written a basic [Design Document][link] for this feature, if you're curious.)

[link]: https://docs.google.com/document/d/144-L4UUBg770dMDOIyuuSYg3jWwdW_L-GpAGswZQyIU/edit


---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/718

Received on Thursday, 2 July 2015 07:46:16 UTC