You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HTTP] Replace X-Moz: Prefetch with Sec-Purpose: Prefetch #27171
Check content open issues to see if any pertain to the subject matter. If there are any that can be closed because of the work, do so. If there are any that can be fixed relatively quickly because of the knowledge from completing this issue and you have time, feel free to go ahead and fix them.
Check if glossary updates are required for the feature you're documenting - whether an existing term needs to be updated or a new term should be added.
Check if BCD update means that content pages need to have experimental markup removed or deprecated markup added (front matter tags and macros).
prefetch has historically not been well standardized but this is part of the work to make it so.
Sec-Purpose: prefetch replaces X-mox: prefetch on FF115, and Purpose: prefetch on Chrome (sometime) , all of which tell the server this is a prefetch request
Sec-Fetch-Dest must be set to "" (empty). This maps to value of the as attribute in the Link definition. Chrome currently sets this value.
The Accept Header must include the same info as a navigation fetch. Currently Chrome does this but FF uses the "default" value
If the Accept header is always set as the same value then there is no need to set VARY header for the prefetch.
Prefetch obeys normal HTTP cache rules. Chrome currently does a wierd 5 minute wait where it doesn't validate the cache for prefetch records.
Must obey CORS, but very permissively. The prefetch can get any file, so if any file would succeed the CORS check then the request will succeed.
Anyway, all of that means that we're kind of "half way through" implementing the standard stuff on all browsers. I can explain where we want to go and where we are, but it is going to be messy. Still playing.
Activity
hamishwillee commentedon Jun 19, 2023
This is part of a bigger job described in #23553 around harmonizing prefetch behaviour. The status is WIP while I work out what can be done now.
Useful resources/related issues
prefetchlink once the spec and implementations are finalized #23553EDIT simple version:
Sec-Purpose: prefetchreplacesX-mox: prefetchon FF115, andPurpose: prefetchon Chrome (sometime) , all of which tell the server this is a prefetch requestSec-Fetch-Destmust be set to "" (empty). This maps to value of theasattribute in theLinkdefinition. Chrome currently sets this value.AcceptHeader must include the same info as a navigation fetch. Currently Chrome does this but FF uses the "default" valueAcceptheader is always set as the same value then there is no need to setVARYheader for the prefetch.Anyway, all of that means that we're kind of "half way through" implementing the standard stuff on all browsers. I can explain where we want to go and where we are, but it is going to be messy. Still playing.
Status:
Sec-Purpose: Prefetchnew document - Ff115 Sec-Purpose HTTP header plus some related changes in HTML #27499PurposeandX-Moz: Prefetch"legacy" docs? - Decided not to do these but capture in other docs.