The
Sec-Purpose
fetch metadata request header
indicates the purpose for which the requested resource will be used, when that purpose is something other than immediate use by the user-agent.
The only purpose that is currently defined is
prefetch
, which indicates that the resource is being requested in anticipation that it will be needed by a page that is likely to be navigated to in the near future, such as a page linked in search results or a link that a user has hovered over.
The server can use this knowledge to: adjust the caching expiry for the request, disallow the request, or perhaps to treat it differently when counting page visits.
The header is sent when a page is loaded that has a
<link>
element with attribute
rel="prefetch"
.
Note that if this header is set then a
Sec-Fetch-Dest
header in the request must be set to
empty
(any value in the
<link>
attribute
as
is ignored) and the
Accept
header should match the value used for normal navigation requests.