-
Notifications
You must be signed in to change notification settings - Fork 331
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
Send Sec-Purpose: prefetch
header for prefetch requests
#1576
Conversation
Sec-Purpose: prefetch
header for prefetch requests
If this lands, please don't forget to register the header. |
That's a good point. Let's define this header then in its own section in HTTP extensions? Also, we should probably define it as a structured header given that its new and use https://fetch.spec.whatwg.org/#concept-header-list-set-structured-header to set it. |
Done, hope this is right :) |
The purpose headers allows servers to discern between regular requests and "resource hints" - requests that are only meant to populate caches. This replaces the existing `Purpose` and `x-moz: prefetch` headers. Closes w3c/webappsec-fetch-metadata#84 Part of whatwg/html#8111
@annevk all the checkboxes for this and for whatwg/html#8111 are ticked! Anything missing? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed some more commits. This looks good now. (Once the HTML PR is approved I will merge this.)
Prefetch is simply a fetch, which populates the HTTP cache, with no post-processing of the resource and with a special header Sec-Purpose: prefetch. (The latter is specified in whatwg/fetch#1576.) Closes #5229. Closes w3c/resource-hints#86. Closes w3c/resource-hints#74. Closes whatwg/fetch#1008.
Header registration: protocol-registries/http-fields#37. |
The WebKit bug link looks incorrect; did you intend to link a different bug? |
@jeremyroman thank you, I found a more suitable reference. |
Send
Sec-Purpose: prefetch
for prefetch requestsThe purpose headers allows servers to discern between regular requests
and "resource hints" - requests that are only meant to populate
caches.
This replaces the existing
Purpose
andx-moz: prefetch
headers.Closes w3c/webappsec-fetch-metadata#84
Closes w3c/resource-hints#74
Part of whatwg/html#8111
At least two implementers are interested (and none opposed):
Tests are written and can be reviewed and commented upon at:
Implementation bugs are filed:
1358419:
Sec-Purpose
header1788167: Align prefetch with spec
MDN issue is filed: Update
prefetch
link once the spec and implementations are finalized mdn/content#23553(See WHATWG Working Mode: Changes for more details.)
Preview | Diff