Skip to content

Commit

Permalink
Add note about Sec-Purpose: Prefetch
Browse files Browse the repository at this point in the history
  • Loading branch information
noamr committed Jan 4, 2023
1 parent 2855355 commit fc280cd
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -5313,9 +5313,15 @@ run these steps:
<li><p><a abstract-op lt="append the Fetch metadata headers for a request">Append the Fetch metadata headers for <var>httpRequest</var></a>.
[[!FETCH-METADATA]]

<li><p>If <var>httpRequest</var>'s <a for=request>initiator</a> is "<code>prefetch</code>", then
<a for="header list">append</a> (`<code>Sec-Purpose</code>`, "<code>prefetch</code>") to
<var>httpRequest</var>'s <a for=request>header list</a>.
<li>
<p>If <var>httpRequest</var>'s <a for=request>initiator</a> is "<code>prefetch</code>", then
<a for="header list">append</a> (`<code>Sec-Purpose</code>`, "<code>prefetch</code>") to
<var>httpRequest</var>'s <a for=request>header list</a>.

<p class=note>This header gives servers an opportunity to handle prefetches differently from
regular requests. For example, the server may allow caching for a longer period for a prefetch
request, disallow prefetches by rejecting the request, or treat it differently for the purpose
of counting page visits.

<li><p>If <var>httpRequest</var>'s <a for=request>header list</a>
<a for="header list">does not contain</a> `<code>User-Agent</code>`, then user agents should
Expand Down

0 comments on commit fc280cd

Please sign in to comment.