Skip to content

Make it clearer that cache mode "default" follows normal logic #340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 30 additions & 22 deletions Overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -3329,12 +3329,29 @@ <h3 id="http-network-or-cache-fetch"><span class="secno">5.5 </span>HTTP-network
<li><p>Let <var>response</var> be null.

<li>
<p>If <var>httpRequest</var>'s
<a href="#concept-request-cache-mode" title="concept-request-cache-mode">cache mode</a> is neither
"<code title="">no-store</code>" nor "<code title="">reload</code>", and there is a <em>complete</em>
<a href="#concept-response" title="concept-response">response</a> in the HTTP cache for
<var>httpRequest</var> run these substeps:
<!-- XXX xref "HTTP cache" -->
<p>If <var>httpRequest</var>'s <a href="#concept-request-cache-mode" title="concept-request-cache-mode">cache mode</a> is
"<code title="">default</code>", then follow the normal procedures to determine whether the
HTTP cache has a <a href="#concept-response" title="concept-response">response</a> for <var>httpRequest</var>.

<p class="note">Including taking into account any
`<code title="http-cache-control">Cache-Control</code>` and `<code title="http-pragma">Pragma</code>`
<a href="#concept-header" title="concept-header">headers</a>.

<p>If there is such a <a href="#concept-response" title="concept-response">response</a>, then set <var>response</var>
to it. Otherwise, if necessary, modify <var>httpRequest</var>'s
<a href="#concept-request-header-list" title="concept-request-header-list">header list</a> with revalidation or resume
<a href="#concept-header" title="concept-header">headers</a>.
<!-- XXX modify, revalidation headers, resume headers -->

<p class="note">Unfortunately this is vaguer than intended. The HTTP cache specification does not
provide the necessary hooks to make this (or indeed, what follows) crystal clear.
<!-- XXX HTTP cache -->

<li>
<p>Otherwise, if <var>httpRequest</var>'s <a href="#concept-request-cache-mode" title="concept-request-cache-mode">cache mode</a>
is neither "<code title="">no-store</code>" nor "<code title="">reload</code>", and there is a
<em>complete</em> <a href="#concept-response" title="concept-response">response</a> in the HTTP cache for
<var>httpRequest</var>, then run these substeps:

<ol>
<li>
Expand All @@ -3347,28 +3364,19 @@ <h3 id="http-network-or-cache-fetch"><span class="secno">5.5 </span>HTTP-network
<a href="#concept-header" title="concept-header">header</a> into account.

<li><p>Otherwise, if <var>httpRequest</var>'s
<a href="#concept-request-cache-mode" title="concept-request-cache-mode">cache mode</a> is "<code title="">default</code>" and the
<a href="#concept-response" title="concept-response">response</a> in the HTTP cache for <var>httpRequest</var> does
not require revalidation, then set <var>response</var> to that
<a href="#concept-response" title="concept-response">response</a>.
<!-- XXX xref "revalidation" -->

<li><p>Otherwise, if <var>httpRequest</var>'s
<a href="#concept-request-cache-mode" title="concept-request-cache-mode">cache mode</a> is either "<code title="">default</code>"
or "<code title="">no-cache</code>", modify <var>httpRequest</var>'s
<a href="#concept-request-header-list" title="concept-request-header-list">header list</a> with revalidation
<a href="#concept-header" title="concept-header">headers</a>.
<a href="#concept-request-cache-mode" title="concept-request-cache-mode">cache mode</a> is "<code title="">no-cache</code>", then
modify <var>httpRequest</var>'s <a href="#concept-request-header-list" title="concept-request-header-list">header list</a> with
revalidation <a href="#concept-header" title="concept-header">headers</a>.
<!-- XXX modify, revalidation headers -->
</ol>

<li><p>Otherwise, if <var>httpRequest</var>'s
<a href="#concept-request-cache-mode" title="concept-request-cache-mode">cache mode</a> is either
"<code title="">default</code>" or "<code title="">force-cache</code>", and there is a
<em>partial</em> <a href="#concept-response" title="concept-response">response</a> in the HTTP cache for
<var>httpRequest</var>, modify <var>httpRequest</var>'s
<a href="#concept-request-cache-mode" title="concept-request-cache-mode">cache mode</a> is "<code title="">force-cache</code>", and
there is a <em>partial</em> <a href="#concept-response" title="concept-response">response</a> in the HTTP cache for
<var>httpRequest</var>, then modify <var>httpRequest</var>'s
<a href="#concept-request-header-list" title="concept-request-header-list">header list</a> with resume
<a href="#concept-header" title="concept-header">headers</a>.
<!-- XXX xref partial, modify, resume headers -->
<!-- XXX partial, modify, resume headers -->

<li>
<p>If <var>response</var> is null, run these substeps:
Expand Down
52 changes: 30 additions & 22 deletions Overview.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -3257,12 +3257,29 @@ <h3>HTTP-network-or-cache fetch</h3>
<li><p>Let <var>response</var> be null.

<li>
<p>If <var>httpRequest</var>'s
<span title=concept-request-cache-mode>cache mode</span> is neither
"<code title>no-store</code>" nor "<code title>reload</code>", and there is a <em>complete</em>
<span title=concept-response>response</span> in the HTTP cache for
<var>httpRequest</var> run these substeps:
<!-- XXX xref "HTTP cache" -->
<p>If <var>httpRequest</var>'s <span title=concept-request-cache-mode>cache mode</span> is
"<code title>default</code>", then follow the normal procedures to determine whether the
HTTP cache has a <span title=concept-response>response</span> for <var>httpRequest</var>.

<p class="note">Including taking into account any
`<code title=http-cache-control>Cache-Control</code>` and `<code title=http-pragma>Pragma</code>`
<span title=concept-header>headers</span>.

<p>If there is such a <span title=concept-response>response</span>, then set <var>response</var>
to it. Otherwise, if necessary, modify <var>httpRequest</var>'s
<span title=concept-request-header-list>header list</span> with revalidation or resume
<span title=concept-header>headers</span>.
<!-- XXX modify, revalidation headers, resume headers -->

<p class="note">Unfortunately this is vaguer than intended. The HTTP cache specification does not
provide the necessary hooks to make this (or indeed, what follows) crystal clear.
<!-- XXX HTTP cache -->

<li>
<p>Otherwise, if <var>httpRequest</var>'s <span title=concept-request-cache-mode>cache mode</span>
is neither "<code title>no-store</code>" nor "<code title>reload</code>", and there is a
<em>complete</em> <span title=concept-response>response</span> in the HTTP cache for
<var>httpRequest</var>, then run these substeps:

<ol>
<li>
Expand All @@ -3275,28 +3292,19 @@ <h3>HTTP-network-or-cache fetch</h3>
<span title=concept-header>header</span> into account.

<li><p>Otherwise, if <var>httpRequest</var>'s
<span title=concept-request-cache-mode>cache mode</span> is "<code title>default</code>" and the
<span title=concept-response>response</span> in the HTTP cache for <var>httpRequest</var> does
not require revalidation, then set <var>response</var> to that
<span title=concept-response>response</span>.
<!-- XXX xref "revalidation" -->

<li><p>Otherwise, if <var>httpRequest</var>'s
<span title=concept-request-cache-mode>cache mode</span> is either "<code title>default</code>"
or "<code title>no-cache</code>", modify <var>httpRequest</var>'s
<span title=concept-request-header-list>header list</span> with revalidation
<span title=concept-header>headers</span>.
<span title=concept-request-cache-mode>cache mode</span> is "<code title>no-cache</code>", then
modify <var>httpRequest</var>'s <span title=concept-request-header-list>header list</span> with
revalidation <span title=concept-header>headers</span>.
<!-- XXX modify, revalidation headers -->
</ol>

<li><p>Otherwise, if <var>httpRequest</var>'s
<span title=concept-request-cache-mode>cache mode</span> is either
"<code title>default</code>" or "<code title>force-cache</code>", and there is a
<em>partial</em> <span title=concept-response>response</span> in the HTTP cache for
<var>httpRequest</var>, modify <var>httpRequest</var>'s
<span title=concept-request-cache-mode>cache mode</span> is "<code title>force-cache</code>", and
there is a <em>partial</em> <span title=concept-response>response</span> in the HTTP cache for
<var>httpRequest</var>, then modify <var>httpRequest</var>'s
<span title=concept-request-header-list>header list</span> with resume
<span title=concept-header>headers</span>.
<!-- XXX xref partial, modify, resume headers -->
<!-- XXX partial, modify, resume headers -->

<li>
<p>If <var>response</var> is null, run these substeps:
Expand Down