Web-Facing Change PSA: ServiceWorker support for Speculation Rules Prefetch

42 views
Skip to first unread message

Hiroshige Hayashizaki

unread,
Jun 20, 2025, 1:00:40 AMJun 20
to blink-dev, Domenic Denicola, Kouhei Ueno, Hiroki Nakagawa, deno...@chromium.org

Contact emails

hiro...@chromium.org


Specification

https://wicg.github.io/nav-speculation/prefetch.html


Design docs


https://docs.google.com/document/d/192ZLkKcaUE_9Qt8bW9OZLViEEbtxOAgq5WYR87m79IE/edit?usp=sharing


Summary

This feature enables ServiceWorker-controlled prefetches, that is a speculation rules prefetch to URLs controlled by a Service Worker. Previously, the prefetch is cancelled upon detecting a controlling Service Worker, thus subsequent navigation to the prfetch target is served by the non-prefetch path. This feature will enable the prefetch request to go through the Service Worker's fetch handler and the response with the Service Worker interception is cached in the prefetch cache, resulting in a subsequent navigation being served by the prefetch cache. Please use the enterprise policy PrefetchWithServiceWorkerEnabled to control this feature.



Blink component

Blink>ServiceWorker


Risks


Interoperability and Compatibility

This is a bug fix to the existing speculation rules prefetch feature, and as such inherits the same interoperability status as that feature: Gecko is implementing, and WebKit is silent. We are ensuring the specification is fully updated and the test suite is exhaustive, so that as Gecko implements they can get the same behavior.


This does make more prefetches succeed when they would have previously failed, which is a behavior change. But we do not anticipate it being a significant compatibility risk. The explainer document [1] contains more details on exactly what web developers will see.


[1]: https://docs.google.com/document/d/192ZLkKcaUE_9Qt8bW9OZLViEEbtxOAgq5WYR87m79IE/edit?tab=t.0#heading=h.8i2u299uv5yh



Gecko: Neutral (https://github.com/mozilla/standards-positions/issues/620#issuecomment-2546739520)


WebKit: No signal (https://github.com/WebKit/standards-positions/issues/54)


Web developers: Strongly positive Service workers are the top actionable reason for prefetch failure, indicating many web developers are running into this issue. (Behind non-actionable ones like battery saver or preloading disabled.) We've also heard directly from several sites that this has been an adoption blocker.


Other signals:


WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

None



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?

No

Android WebView does not yet support prefetch



Is this feature fully tested by web-platform-tests?

Yes

https://wpt.fyi/results/speculation-rules/prefetch/tentative/service-worker?label=experimental&label=master&aligned



Flag name on about://flags

None


Finch feature name

PrefetchServiceWorker


Rollout plan

(RARE) Experiment users ramp up over time


Requires code in //chrome?

False


Tracking bug

https://issues.chromium.org/40947546


Estimated milestones

Shipping on desktop

138

Shipping on Android

138


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/4996410105397248?gate=6656927492472832


This intent message was generated by Chrome Platform Status.


Reply all
Reply to author
Forward
0 new messages