Skip to content

Commit b35b625

Browse files
committed
Define link processing for prefetch
Prefetch is simply a fetch with `prefetch-src` CSP and no post-processing of the resource. Closes #5229
1 parent 5be9e62 commit b35b625

File tree

1 file changed

+35
-5
lines changed

1 file changed

+35
-5
lines changed

source

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25921,15 +25921,45 @@ document.body.appendChild(wbr);</code></pre>
2592125921
link</span>. This keyword is <span>body-ok</span>.</p>
2592225922

2592325923
<p>The <code data-x="rel-prefetch">prefetch</code> keyword indicates that preemptively <span
25924-
data-x="concept-fetch">fetching</span> and caching the specified resource is likely to be
25925-
beneficial, as it is highly likely that the user will require this resource for future
25926-
navigations. <span w-nodev>User agents must implement the processing model of the <code
25927-
data-x="rel-prefetch">prefetch</code> keyword described in <cite>Resource Hints</cite>.</span>
25928-
<ref spec=RESOURCEHINTS></p>
25924+
data-x="concept-fetch">fetching</span> and caching the specified resource or same-site document is
25925+
likely to be beneficial, as it is highly likely that the user will require this resource for
25926+
future navigations.</p>
2592925927

2593025928
<p>There is no default type for resources given by the <code data-x="rel-prefetch">prefetch</code>
2593125929
keyword.</p>
2593225930

25931+
<p>The <span>fetch and process the linked resource</span> algorithm for <code
25932+
data-x="rel-prefetch">prefetch</code> links, given a <code>link</code> element
25933+
<var>el</var>, is as follows:</p>
25934+
25935+
<ol>
25936+
<li><p>If <var>el</var>'s <code data-x="attr-link-href">href</code> attribute's value is the
25937+
empty string, then return.</p></li>
25938+
25939+
<li><p>Let <var>options</var> be the result of <span data-x="create link options from
25940+
element">creating link options</span> from <var>el</var>.</p></li>
25941+
25942+
<li><p>Let <var>request</var> be the result of <span data-x="create a link request">creating a
25943+
link request</span> given <var>options</var>.</p></li>
25944+
25945+
<li><p>Set <var>request</var>'s <span data-x="concept-request-destination">destination</span>
25946+
to "<code data-x="">prefetch</code>".</p></li>
25947+
25948+
<li><p>Set <var>request</var>'s <span data-x="concept-request-initiator">initiator</span>
25949+
to "<code data-x="">prefetch</code>".</p></li>
25950+
25951+
<li><p>Set <var>request</var>'s <span
25952+
data-x="concept-request-header-list">header list</span> to « (`<code
25953+
data-x="">Sec-Purpose</code>`, `<code data-x="">Prefetch</code>) ».</p></li>
25954+
25955+
<li><p>The user agent should <span data-x="concept-fetch">fetch</span> <var>request</var>. User
25956+
agents may delay the fetching of <var>request</var> to prioritize othere requests that are
25957+
necessary for the current document.</p></li>
25958+
</ol>
25959+
25960+
<p>The <span>process a link header</span> steps for this type of linked resource are to do
25961+
nothing.</p>
25962+
2593325963

2593425964
<h5>Link type "<dfn for="link/rel" attr-value><code
2593525965
data-x="rel-preload">preload</code></dfn>"</h5>

0 commit comments

Comments
 (0)