← Back to release summary

ServiceWorker static routing API

Category
Service Worker
Type
New or changed feature
Status
Enabled by default (Chrome 123)
Intent stage
None

Summary

This API allows developers to configure the routing, and allows them to offload simple things ServiceWorkers do. If the condition matches, the navigation happens without starting ServiceWorkers or executing JavaScript, which allows web pages to avoid performance penalties due to ServiceWorker interceptions.

Motivation

Starting ServiceWorkers is known to be a slow process, and web users need to wait for its startup if the ServiceWorker intercepts loading the page resources. At the same time, the ServiceWorker brings flexibility to the transport layer, and it behaves as a client-side proxy. Developers can implement offline support or provide client-side content modification with it. Currently, ServiceWorkers intercept all requests for pages within their scope, which brings a performance penalty within the scope.

Standards & signals

Explainers: https://github.com/WICG/service-worker-static-routing-api

View on chromestatus.com