Use the Service Worker Static Routing API to bypass the service worker for specific paths | Blog | Chrome for Developers
From Chrome 123, the Service Worker Static Routing API is available. This API lets you declaratively state how certain resource paths should be fetched, meaning that the browser does not need to run a service worker only to fetch responses from a cache, or directly from the network. This API has been in origin trial since Chrome 116, and this post details the API launching in Chrome 123. To use the API call event.addRoutes on the service worker install event. Pass this method a list of routes, with the following properties: In the following example, URLs that start with "/articles" are routed to the service worker if it is currently running. Where there are multiple conditions, for example urlPattern and runningStatus, all conditions must be met for the route to be used. In the following example, posts to a form are sent directly to the network and bypass the service worker. In the following example, the cache storage named "pictures" is used for fetching files with a file extension of
Chrome for Developers Blog Use the Service Worker Static Routing API to bypass the service worker for specific paths Stay organized with collections Save and categorize content based on your preferences. Rachel Andrew From Chrome 123, the Service Worker Static Routing API is available. This API lets you declaratively state how certain resource paths should be fetched, meaning that the browser does not need to run a service worker only to fetch responses from a cache, or directly from the network. This API has been in origin trial since Chrome 116, and this post details the API launching in Chr
Explore this link on the map →related reading
- Service Worker API - Web APIs | MDNdeveloper.mozilla.org
- Handling navigation requests | Articles | web.devweb.dev
- The service worker lifecycle | Articles | web.devweb.dev
- Service worker overview | Workbox | Chrome for Developersdeveloper.chrome.com
- A service worker's life | Workbox | Chrome for Developersdeveloper.chrome.com
- workbox-precaching | Modules | Chrome for Developersdeveloper.chrome.com
- Grainradgrainrad.com
- Service worker registration | Articles | web.devweb.dev
- The service worker lifecycle | Articles | web.devweb.dev
- ServiceWorkerGlobalScope: skipWaiting() method - Web APIs | MDNdeveloper.mozilla.org
- GitHub - lukeed/webpack-route-manifest: Generate an asset manifest file, keyed by route patterns! · GitHubgithub.com
- Cursor Docs — Agent, Rules, MCP, Skills & CLIdocs.cursor.com