Intent to Ship: No-Vary-Search Hint for Prefetch Speculation Rules

128 views
Skip to first unread message

Liviu Tinta

unread,
Nov 1, 2023, 9:56:11 AM11/1/23
to blink-dev

Contact emails

dom...@chromium.orgjbr...@chromium.orgliviu...@chromium.org

Explainer

https://github.com/WICG/nav-speculation/blob/main/triggers.md#no-vary-search-hint

Specification

https://wicg.github.io/nav-speculation/speculation-rules.html#speculation-rules-processing

Summary

Adds a hint to speculation rules that informs the navigation prefetch cache that the URL to be prefetched expects to receive the same No-Vary-Search header in the response. The hint is useful because prefetches that depend on No-Vary-Search to match to navigations do not benefit the user if the navigation happens before prefetch headers return from the server. Using the hint, the web browser will expect, but verify, that the No-Vary-Search hint matches with the No-Vary-Search header. If the No-Vary-Search hint does not match the No-Vary-Search header received then the web browser will send a new request.


We would like to ship "No-Vary-Search Hint for Prefetch Speculation Rules" together with "No-Vary-Search support in navigation prefetch cache" (https://chromestatus.com/feature/5071247189213184).


Blink component

Internals>Preload

TAG review

Not applicable. The TAG has already given a negative opinion on the overall complexity of speculation rules (https://github.com/w3ctag/design-reviews/issues/721), so we anticipate it would not be a good use of their time to review additions to the syntax. The addition itself is small and any architectural questions about it would be covered under the general closed speculation rules review.

TAG review status

Not applicable

Chromium Trial Name

NoVarySearchPrefetch

Origin Trial documentation link

https://developer.chrome.com/origintrials/#/view_trial/4146689356901384193


WebFeature UseCounter name

kSpeculationRulesNoVarySearchHint

Risks



Interoperability and Compatibility



Gecko: No signal (https://github.com/mozilla/standards-positions/issues/620#issuecomment-1608195274)

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

Web developersGoogle Search has been experimenting with No-Vary-Search header / Speculation Rules "expects_no_vary_search" (referred in this intent as No-Vary-Search hint for prefetch Speculation Rules). This functionality helps Google Search to match prefetched content to the next user navigation. Developers can use parameters in the prefetched URL that are not needed when navigating to the actual link (e.g. the source of the link click). The server can customize behavior using these parameters without causing a cache miss in the browser.
"expects_no_vary_search" addition to Speculation Rules allows the browser to completely handle the case where the user navigates to a URL that is currently prefetched by waiting for the ongoing prefetch instead of directly requesting the page from the server.
Google Search conducted experiments prefetching Search results pages from the search box and other links that lead to another Search results page. There was significant latency improvement for navigating to Search result pages prefetched using No-Vary-Search header and "expects_no_vary_search".

Other signals: No-Vary-Search Hint for Prefetch Speculation Rules has been discussed, together with No-Vary-Search header at Web Perf WG meeting at TPAC 2023


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

The No-Vary-Search hint is represented as a new json attribute ("expects_no_vary_search") in prefetch Speculation Rules. The Speculation Rules can be viewed in DevTools on the Application tab under Preloading->Speculation Rules.

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

Yes

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

Yes

https://wpt.fyi/results/speculation-rules/prefetch/no-vary-search?label=master&label=experimental&aligned



Flag name on chrome://flags



Finch feature name

SpeculationRulesNoVarySearchHint

Requires code in //chrome?

False

Estimated milestones

Shipping on desktop121
OriginTrial desktop last120
OriginTrial desktop first115
DevTrial on desktop115
Shipping on Android121
OriginTrial Android last120
OriginTrial Android first115
DevTrial on Android115
Shipping on WebView121
OriginTrial webView last120
OriginTrial webView first115


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

None

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/4887338302308352

Links to previous Intent discussions

Intent to prototype: https://groups.google.com/a/chromium.org/g/blink-dev/c/HX2iHMBjg7s/m/Zu4L5-l_AQAJ 

Mike Taylor

unread,
Nov 6, 2023, 7:57:30 PM11/6/23
to Liviu Tinta, blink-dev

LGTM1

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAHaAqYL58DHinL5sypzVjkjttz8KzRq-g%3DYd31eKNY43C9fUSA%40mail.gmail.com.

Daniel Bratell

unread,
Nov 8, 2023, 10:22:01 AM11/8/23
to Mike Taylor, Liviu Tinta, blink-dev

Chris Harrelson

unread,
Nov 8, 2023, 11:50:12 AM11/8/23
to Daniel Bratell, Mike Taylor, Liviu Tinta, blink-dev
LGTM3

(but I don't think it makes sense to ship this without the other intent related to it?) 

Reply all
Reply to author
Forward
0 new messages