Intent to Prototype: Speculation rules: tag field

145 views
Skip to first unread message

Domenic Denicola

unread,
Feb 5, 2025, 12:37:34 AM2/5/25
to blink-dev, robe...@chromium.org

Contact emails

robe...@chromium.orgdom...@chromium.org

Explainer

https://github.com/WICG/nav-speculation/blob/main/speculation-rules-tags.md

Specification

None yet, but we'll be writing one during the prototype phase

Summary

This enables developers to add tag field to speculation rules. This optional field can be used to track the source of speculation rules, e.g. to treat them differently at an intermediary server. Any tags associated with a speculation will be sent with the Sec-Speculation-Tags header.



Blink component

Internals>Preload

Motivation

There may be multiple parties on a single referring page which are setting up speculation rules, e.g. CDNs, frameworks, or individual pages. It can be useful for server code to respond differently to speculative navigation requests, depending on which source triggered them. Today, there is no way for servers to perform this kind of differentiation. All speculative navigation requests appear the same to the server. This feature provides such a mechanism.



Initial public proposal

https://github.com/WICG/nav-speculation/issues/336

Search tags

speculationrulesprerenderingprefetch

TAG review

https://github.com/w3ctag/design-reviews/issues/721 The TAG is generally dissatisfied with speculation rules, claiming that the syntax is too complicated. As such, we don't believe asking for review of this additional feature would be fruitful.

TAG review status

Not applicable

Risks



Interoperability and Compatibility

The entire speculative loading feature is a progressive enhancement, so in general risks are low in this area.



Gecko: No signal (https://github.com/mozilla/standards-positions/issues/1172) Mozilla is neutral on speculation rules syntax in general (https://github.com/mozilla/standards-positions/issues/620), although positive on prefetching. We opened a new request for this specific feature to ensure we captured any of their input.

WebKit: No signal (https://github.com/WebKit/standards-positions/issues/54) WebKit has not yet responded to our 2022 request for a position on speculation rules in general. We have updated the thread to point them to this latest addition anyway.

Web developers: Positive (https://github.com/WICG/nav-speculation/blob/main/speculation-rules-tags.md#stakeholder-feedback)

Other signals:

Activation

Due to how new fields in speculation rules are interpreted in older versions of Chrome, using this field on the rule level can cause the rules to be dropped. A workaround is using it on the ruleset level only during this transition period. https://github.com/WICG/nav-speculation/blob/main/speculation-rules-tags.md#location-of-the-tags-within-the-json



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

We would like to use the presence of ruleset-level tags to improve DevTools's existing display of speculation rules rulesets: https://issues.chromium.org/issues/393408589



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

Not yet, but we plan on doing so during the prototyping phase

Flag name on about://flags

None

Finch feature name

SpeculationRulesTag

Requires code in //chrome?

False

Tracking bug

https://issues.chromium.org/issues/381687257

Estimated milestones

No milestones specified



Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/6503137340555264?gate=6399349724282880

This intent message was generated by Chrome Platform Status.
Reply all
Reply to author
Forward
0 new messages