← Back to release summary

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

Ecosystem

Docs: https://docs.google.com/document/d/1-ebnv7OFiVd3k2-jbtQGO5s3BKHIp7lRx3ujhgNKvB0/edit

Explainers: https://github.com/wanderview/fetchevent-worker-timing/blob/master/explainer.md

View on chromestatus.com