demo · v140
Mode Picker
Three autopreload modes — browser (new), manual, and off. Each makes a different trade-off between predictability and how aggressive the UA is. Pick one and see the resulting routing config and the matching SW code.
browser (new in 140)
UA-driven heuristics. Preloads sub-resources it predicts based on past visits to the same URL pattern. Default-safe.
manual
Page declares preload intent via the Service-Worker-Allowed + custom headers, or via the Static Routing API.
off
No preload. Equivalent to pre-existing behaviour. Use when you've measured that SW logic dominates network in your traces.
// One call, one mode.
self.registration.serviceWorker.setAutopreloadMode("browser");
see also
- SW autopreload browser mode — feature index