[dev-platform] Intent to Prototype: Speculation Rules - Same-Origin Prefetch

61 views
Skip to first unread message

Sunil Mayya

unread,
May 5, 2026, 4:17:16 PM (21 hours ago) May 5
to dev-pl...@mozilla.org
  We intend to prototype support for the Speculation Rules API  same-origin prefetch in Firefox.

  Specification
  Speculative Loading (WHATWG HTML): https://html.spec.whatwg.org/multipage/speculative-loading.html#speculative-loading
  Prefetch (WICG): https://wicg.github.io/nav-speculation/prefetch.html

  Summary
  The Speculation Rules API lets pages express hints about likely future navigations using a JSON-based <script type="speculationrules"> element or an external ruleset referenced by the Speculation-Rules HTTP response header.

  For example:
  <script type="speculationrules">
   {
     "prefetch": [
       { "where": { "href_matches": "/articles/*" } }
     ]
   }
   </script>

  When the browser judges a prefetch appropriate, it speculatively fetches the target URL so the subsequent navigation is faster.

  This initial prototype covers same-origin prefetch only. 
  Cross-origin prefetch is out of scope and will be addressed in a follow-up.

  Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1969396

  Mozilla Standards Position: https://github.com/mozilla/standards-positions/issues/620

  Other browsers
  - Chrome: Shipped
  - Safari: Actively Implementing (same-origin prefetch)

  Platform Coverage
   All

  Web Platform Tests


Regards
Sunil

Sunil Mayya

unread,
6:02 AM (7 hours ago) 6:02 AM
to dev-pl...@mozilla.org

Summary: 
The Speculation Rules API allows pages to declare hints about likely future navigations using a JSON-based script element, enabling the browser to speculatively prefetch target URLs in the background. When the user eventually navigates, the response is already in cache and the page loads significantly faster. This initial prototype covers same-origin prefetch only. Cross-origin prefetch is out of scope and will be addressed in a follow-up.

Bug: 
https://bugzilla.mozilla.org/show_bug.cgi?id=1969396

Specification: 
https://html.spec.whatwg.org/multipage/speculative-loading.html#speculative-loading 
https://wicg.github.io/nav-speculation/prefetch.html

Standards Body: 
WHATWG 

Platform Coverage: 
All

Preference: 
dom.speculation-rules.prefetch.enabled

DevTools Bug: 
https://bugzilla.mozilla.org/show_bug.cgi?id=2037321

Extensions Bug: N/A

Use Counter: N/A

Standards-Positions Discussion: 
https://github.com/mozilla/standards-positions/issues/620

Other Browsers: 
Blink: Shipped (Chrome 110, February 2023) 
WebKit: Actively implementing (same-origin prefetch landed in WebKit trunk)

web-platform-tests: 
https://wpt.fyi/results/speculation-rules


Reply all
Reply to author
Forward
0 new messages