← Back to release summary

Speculation rules: delivery via Speculation-Rules header

Category
Miscellaneous
Type
New or changed feature
Status
Enabled by default (Chrome 121)
Intent stage
Dev trials

Summary

Currently developers can only specify speculation rules using inline script tags. The proposed feature provides an alternative through the "Speculation-Rules" header. Its value must be a URL to a text resource with "application/speculationrules+json" MIME type. The resource's rules will be added to the document's rule set.

Motivation

To adopt speculation rule based preloading, the current approach of using the script tag to specify speculation rules requires modifying existing documents, which is more difficult for some authors to deploy. The proposed Speculation-Rule header provides an alternative to facilitate adoption of the speculation rule based preloading.

Standards & signals

Explainers: https://github.com/WICG/nav-speculation/blob/main/triggers.md#the-proposal

View on chromestatus.com