FetchEvent Worker Timing
- Category
- Service Worker
- Type
- New or changed feature
- Status
- Proposed (Chrome Proposed)
- Intent stage
- Start prototyping
WPT details: https://wpt.fyi/results/service-workers/service-worker/fetch-event-worker-timing-frame.tentative.https.html
Summary
This effort will expose an API on the `FetchEvent` dispatched within a service worker context that allows additional timing information to be associated with the intercepted network load. This information will then be accessible in the main thread context on the resulting `PerformanceResourceTiming` entry.
Motivation
Currently it is somewhat difficult for sites to measure the performance of service worker script that is executed while handling a FetchEvent. The service worker script can take measurements, but there is no easy way to associate this data back to the original network request. It requires an out-of-band communication mechanism like postMessage() or a server beacon with further data stitching to get a coherent view of the load. The goal of this feature is to make it easier to measure and understand the performance of service worker FetchEvent processing on network loads.
Standards & signals
- Firefox: No signal
- Safari: No signal
- Web developers: Positive — Multiple large sites and data analytics providers are interested in this.
- Tracking bug: https://bugs.chromium.org/p/chromium/issues/detail?id=900700
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=service-workers%2Fservice-worker%2Ffetch-event-worker-timing-frame
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+FetchEvent%20Worker%20Timing
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=FetchEvent%20Worker%20Timing
- Baseline status: https://webstatus.dev/?q=FetchEvent%20Worker%20Timing
Docs: https://docs.google.com/document/d/1-ebnv7OFiVd3k2-jbtQGO5s3BKHIp7lRx3ujhgNKvB0/edit
Explainers: https://github.com/wanderview/fetchevent-worker-timing/blob/master/explainer.md