Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add speculation rules improvements for Chrome 121 #22262

Merged
merged 5 commits into from
Feb 28, 2024

Conversation

chrisdavidmills
Copy link
Collaborator

@chrisdavidmills chrisdavidmills commented Feb 20, 2024

Summary

Chrome 121 has added several new features for the Speculation Rules API:

  • The Speculation-Rules HTTP response header, which allows developers to set speculation rules on a page via a response header, without modifying the actual page code. I added a new BCD feature for the header. See https://chromestatus.com/feature/5069400512659456 for more info.
  • Document-sourced rules, which allow developers to specify a set of rules to include or exclude the URLs linked in the document in the list for prefetching/prerendering, rather than specifying an exact list of URLs. I added a sub-feature for the new source key value, document; the related where key is already included in the data. See https://chromestatus.com/feature/5112150536749056
  • The eagerness field, which allows developers to set how eagerly they want URLs to be prefetched/prerendered. I added a sub-feature for eagerness. See https://chromestatus.com/feature/5091678266851328.
  • The No-Vary-Search HTTP response header, which is used to indicate whether URL params should be ignored when deciding whether to fetch a page from cache or not. New feature added for the header. See https://chromestatus.com/feature/5071247189213184
  • The expects_no_vary_search field, which allows developers to report the expected value of the No-Vary-Search response header in the speculation rules, and use that to determine whether a prefetch would be beneficial or not. New sub-feature added for this field. See https://chromestatus.com/feature/4887338302308352

Test results and supporting details

Related issues

@github-actions github-actions bot added data:http 🚠 Compat data for HTTP features. https://developer.mozilla.org/docs/Web/HTTP data:html 📄 Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML labels Feb 20, 2024
@chrisdavidmills chrisdavidmills marked this pull request as draft February 20, 2024 10:25
@chrisdavidmills chrisdavidmills marked this pull request as ready for review February 20, 2024 10:49
Comment on lines 936 to 968
"source_document": {
"__compat": {
"description": "<code>source</code> key <code>document</code> value",
"support": {
"chrome": {
"version_added": "121"
},
"chrome_android": "mirror",
"edge": "mirror",
"firefox": {
"version_added": false
},
"firefox_android": "mirror",
"ie": {
"version_added": false
},
"oculus": "mirror",
"opera": "mirror",
"opera_android": "mirror",
"safari": {
"version_added": false
},
"safari_ios": "mirror",
"samsunginternet_android": "mirror",
"webview_android": "mirror"
},
"status": {
"experimental": true,
"standard_track": true,
"deprecated": false
}
}
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrisdavidmills we crossed our streams again :-)

I think we can remove this bit as I added this as a url and where parameters in #22188. We're making source: url and source: document optional (and maybe eventually removing it?) as it can be implied from whether url and where exists. Therefore don't think we should add that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also a bit weird it being its own standalone item...it would make a bit more sense if it were a subitem of source, but no.

I'll remove it.

Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 👍

@Elchi3 Elchi3 merged commit af9a3a3 into mdn:main Feb 28, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:html 📄 Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML data:http 🚠 Compat data for HTTP features. https://developer.mozilla.org/docs/Web/HTTP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants