demo · v140

ServiceWorker AutoPreload timeline

Compare a navigation with and without v140 AutoPreload's browser mode. The browser-mode timeline starts the network fetch as soon as the navigation begins, in parallel with the service worker bootstrap — shaving the SW startup cost off time-to-first-byte.

SW parse + bootstrap fetch event handler network request first paint
// Browser opts the worker in via Static Routing or registration:
self.addEventListener("install", () => { /* ... */ });
// In v140 the response stream begins BEFORE the fetch handler runs,
// using whatever rule the static router matched.

see also