Skip to content

Commit

Permalink
align spec more closely with cache freshening
Browse files Browse the repository at this point in the history
  • Loading branch information
gterzian committed Jun 20, 2020
1 parent e057e92 commit 77e6483
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4460,16 +4460,21 @@ Range Requests</cite>. [[HTTP-RANGE]] However, this is not widely supported by b
<a for=response>status</a> is <code>304</code>, then:

<ol>
<li>
<p>Update <var>storedResponse</var>'s <a for=response>header list</a> using
<var>forwardResponse</var>'s <a for=response>header list</a>, as per the
"<a href=https://tools.ietf.org/html/rfc7234#section-4.3.4>Freshening Stored Responses upon Validation</a>"
chapter of <cite>HTTP Caching</cite>. [[!HTTP-CACHING]]

<p class="note">This updates the stored response in cache as well.

<li><p>Set <var>response</var> to <var>storedResponse</var>.
<li><p> Set <var>selectedStoredResponse</var> to null.
<li><p> Set <var>selectedStoredResponse</var> to the result of selecting a response from the cache as per the "<a href=https://tools.ietf.org/html/rfc7234#section-4.3.4>Freshening Stored Responses upon Validation</a>" chapter of <cite>HTTP Caching</cite> [[!HTTP-CACHING]], if any.
<li><p> If <var>selectedStoredResponse</var> is not null, then:
<ol>
<li><p>Update <var>storedResponse</var>'s <a for=response>header list</a> using <var>forwardResponse</var>'s <a for=response>header list</a>, as per the "<a href=https://tools.ietf.org/html/rfc7234#section-4.3.4>Freshening Stored Responses upon Validation</a>" chapter of <cite>HTTP Caching</cite>. [[!HTTP-CACHING]]
<li><p class="note">This updates the stored response in cache as well.
<li><p>Set <var>response</var> to <var>storedResponse</var>.
</ol>

<li><p>Otherwise:
<ol>
<li><p> <a for="header list">Delete</a> `<code>If-None-Match</code>` from <var>httpRequest</var>'s <a for=request>header list</a>.
<li><p> <a for="header list">Delete</a> `<code>If-Modified-Since</code>` from <var>httpRequest</var>'s <a for=request>header list</a>.
<li><p>Set <var>forwardResponse</var> be the result of making an <a>HTTP-network fetch</a> using <var>httpRequest</var>.
</ol>
</ol>

<li>
Expand Down

0 comments on commit 77e6483

Please sign in to comment.