← Chrome 151 reference

v151 · performance · service-worker · resource-timing

Resource Timing: Add spec-compliant Service Worker Router timing fields

Chrome 151 adds two new attributes to PerformanceResourceTiming (and PerformanceNavigationTiming): workerMatchedRouterSource and workerFinalRouterSource, which identify which Service Worker Static Router rule was matched and the final source used to fulfil the request.

at a glance

Shipped inChrome 151 (Enabled by default)
StatusEnabled by default
Standards position (Firefox)No signal
Standards position (Safari)No signal
ChromeStatus5172259800088576 — Resource Timing: Add spec-compliant Service Worker Router timing fields
Source: chromestatus.com/feature/5172259800088576

background: Service Worker Static Routing

The Service Worker Static Routing API (shipped in Chrome 123) allows service workers to declare routing rules that short-circuit the fetch event, directing requests to the network, cache, or the fetch handler without waking the service worker. The RouterSource values identify where the final response came from: "network", "cache", "fetch-event", or "race-network-and-fetch-handler".

Source: chromestatus feature summary

shape of the API

AttributeInterfaceDescription
workerMatchedRouterSourcePerformanceResourceTiming, PerformanceNavigationTimingThe RouterSource of the Static Router rule that first matched this request (or "" if no rule matched)
workerFinalRouterSourcePerformanceResourceTiming, PerformanceNavigationTimingThe RouterSource that ultimately served the response (may differ from matched if a race resolved differently)

Deprecation note: The existing non-compliant fields workerMatchedSourceType and workerFinalSourceType will be deprecated in a separate future intent once usage data is collected.

Source: chromestatus feature summary

example

// After a page load, inspect resource timing entries for SW router info
const entries = performance.getEntriesByType('resource');
for (const entry of entries) {
  if (entry.workerMatchedRouterSource) {
    console.log(
      entry.name,
      '→ matched:', entry.workerMatchedRouterSource,
      '→ final:',   entry.workerFinalRouterSource
    );
    // Example output:
    // "/api/data.json" → matched: "race-network-and-fetch-handler" → final: "network"
  }
}

// Navigation timing also includes these fields (Chrome 151+)
const [nav] = performance.getEntriesByType('navigation');
console.log('Nav router source:', nav.workerFinalRouterSource);
Source: chromestatus feature summary

browser support

BrowserSupportNotes
Chrome 151+Enabled by defaultAll platforms
FirefoxNo signal
SafariNo signal
Source: chromestatus.com/feature/5172259800088576

see also