Timing information for ServiceWorker Static Routing API

This document describes the status of the current implementation of the Timing Info for ServiceWorker Static Routing API in Chrome, and how to enable it.

Note that this feature is not available by default. Chrome plans to do an origin trial starting from M131 to evaluate its effectiveness and to allow site authors to give feedback.

What’s supported

The API is implemented according to the explainer.

Following new fields are added to the resourceTimingAPI:

  • workerMatchedRouterSource
  • workerActualRouterSource
  • workerCacheLookupStart

In addition, a new value cache-storage is added to the deliveryType field. Please refer to the explainer for details about each field.

Activation

The API can be enabled by participating in the Origin Trial.

The feature is named ServiceWorkerStaticRouterTimingInfo. Registration for the trial is here. See feature status to find out if the origin trial is currently running.

The origin trial tutorial describes how to participate.

Verifying the API is working

In devtools, run the following piece of javascript after navigating to a page which uses ServiceWorker static routing API.

performance.getEntriesByType('navigation')[0].matchedSourceType;

If it gives you a value, it succeeds. If it gives undefined then the feature is not enabled.

Related Links