blob: d6dd6b086c8b69f5a8cbea61fd10fc679294b1f5 [file] [log] [blame] [view]
Keita Suzuki44b2afc2024-11-07 12:46:351# Timing information for ServiceWorker Static Routing API
2
3- Contact: chrome-loading@google.com
4
5This document describes the status of the current implementation of the
6[**Timing Info for ServiceWorker Static Routing API**](https://github.com/WICG/service-worker-static-routing-api/blob/main/resource-timing-api.md)
7in Chrome, and how to enable it.
8
9Note that this feature is not available by default.
10Chrome plans to do an origin trial starting from M131 to evaluate its
11effectiveness and to allow site authors to give feedback.
12
13## What’s supported
14
15The API is implemented according to the
16[explainer](https://github.com/WICG/service-worker-static-routing-api/blob/main/resource-timing-api.md).
17
18Following new fields are added to the resourceTimingAPI:
19- workerMatchedRouterSource
20- workerActualRouterSource
21- workerCacheLookupStart
22
23In addition, a new value `cache-storage` is added to the `deliveryType` field.
24Please refer to the explainer for details about each field.
25
26## Activation
27
28The API can be enabled by participating in the [Origin Trial](https://developer.chrome.com/blog/origin-trials/).
29
30The feature is named `ServiceWorkerStaticRouterTimingInfo`.
31Registration for the trial is [here](https://developer.chrome.com/origintrials/#/view_trial/1689412810217357313).
32See [feature status](https://chromestatus.com/feature/6309742380318720) to find out
33if the origin trial is currently running.
34
35The [origin trial tutorial](https://developer.chrome.com/docs/web-platform/origin-trials/#take-part-in-an-origin-trial) describes how to participate.
36
37
38## Verifying the API is working
39
40In devtools, run the following piece of javascript after navigating to a page
41which uses ServiceWorker static routing API.
42
43```js
44performance.getEntriesByType('navigation')[0].matchedSourceType;
45```
46
47If it gives you a value, it succeeds.
48If it gives `undefined` then the feature is not enabled.
49
50## Related Links
51
52- [Timing Info for ServiceWorker Static Routing API Explinaer on GitHub](https://github.com/WICG/service-worker-static-routing-api/blob/main/resource-timing-api.md)
53- [Chrome Status](https://chromestatus.com/feature/6309742380318720)