Skip to content

Commit 60e6caf

Browse files
committed
Make it clearer that cache mode "default" follows normal logic
If the cache mode is “default” and you set a Cache-Control header, that should be taken into account when talking to the HTTP cache subsystem. It’s how the cache works by “default”, after all.
1 parent a697191 commit 60e6caf

File tree

2 files changed

+60
-44
lines changed

2 files changed

+60
-44
lines changed

Overview.html

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3329,12 +3329,29 @@ <h3 id="http-network-or-cache-fetch"><span class="secno">5.5 </span>HTTP-network
33293329
<li><p>Let <var>response</var> be null.
33303330

33313331
<li>
3332-
<p>If <var>httpRequest</var>'s
3333-
<a href="#concept-request-cache-mode" title="concept-request-cache-mode">cache mode</a> is neither
3334-
"<code title="">no-store</code>" nor "<code title="">reload</code>", and there is a <em>complete</em>
3335-
<a href="#concept-response" title="concept-response">response</a> in the HTTP cache for
3336-
<var>httpRequest</var> run these substeps:
3337-
<!-- XXX xref "HTTP cache" -->
3332+
<p>If <var>httpRequest</var>'s <a href="#concept-request-cache-mode" title="concept-request-cache-mode">cache mode</a> is
3333+
"<code title="">default</code>", then follow the normal procedures to determine whether the
3334+
HTTP cache has a <a href="#concept-response" title="concept-response">response</a> for <var>httpRequest</var>.
3335+
3336+
<p class="note">Including taking into account any
3337+
`<code title="http-cache-control">Cache-Control</code>` and `<code title="http-pragma">Pragma</code>`
3338+
<a href="#concept-header" title="concept-header">headers</a>.
3339+
3340+
<p>If there is such a <a href="#concept-response" title="concept-response">response</a>, then set <var>response</var>
3341+
to it. Otherwise, if necessary, modify <var>httpRequest</var>'s
3342+
<a href="#concept-request-header-list" title="concept-request-header-list">header list</a> with revalidation or resume
3343+
<a href="#concept-header" title="concept-header">headers</a>.
3344+
<!-- XXX modify, revalidation headers, resume headers -->
3345+
3346+
<p class="note">Unfortunately this is vaguer than intended. The HTTP cache specification does not
3347+
provide the necessary hooks to make this (or indeed, what follows) crystal clear.
3348+
<!-- XXX HTTP cache -->
3349+
3350+
<li>
3351+
<p>Otherwise, if <var>httpRequest</var>'s <a href="#concept-request-cache-mode" title="concept-request-cache-mode">cache mode</a>
3352+
is neither "<code title="">no-store</code>" nor "<code title="">reload</code>", and there is a
3353+
<em>complete</em> <a href="#concept-response" title="concept-response">response</a> in the HTTP cache for
3354+
<var>httpRequest</var>, then run these substeps:
33383355

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

33493366
<li><p>Otherwise, if <var>httpRequest</var>'s
3350-
<a href="#concept-request-cache-mode" title="concept-request-cache-mode">cache mode</a> is "<code title="">default</code>" and the
3351-
<a href="#concept-response" title="concept-response">response</a> in the HTTP cache for <var>httpRequest</var> does
3352-
not require revalidation, then set <var>response</var> to that
3353-
<a href="#concept-response" title="concept-response">response</a>.
3354-
<!-- XXX xref "revalidation" -->
3355-
3356-
<li><p>Otherwise, if <var>httpRequest</var>'s
3357-
<a href="#concept-request-cache-mode" title="concept-request-cache-mode">cache mode</a> is either "<code title="">default</code>"
3358-
or "<code title="">no-cache</code>", modify <var>httpRequest</var>'s
3359-
<a href="#concept-request-header-list" title="concept-request-header-list">header list</a> with revalidation
3360-
<a href="#concept-header" title="concept-header">headers</a>.
3367+
<a href="#concept-request-cache-mode" title="concept-request-cache-mode">cache mode</a> is "<code title="">no-cache</code>", then
3368+
modify <var>httpRequest</var>'s <a href="#concept-request-header-list" title="concept-request-header-list">header list</a> with
3369+
revalidation <a href="#concept-header" title="concept-header">headers</a>.
33613370
<!-- XXX modify, revalidation headers -->
33623371
</ol>
33633372

33643373
<li><p>Otherwise, if <var>httpRequest</var>'s
3365-
<a href="#concept-request-cache-mode" title="concept-request-cache-mode">cache mode</a> is either
3366-
"<code title="">default</code>" or "<code title="">force-cache</code>", and there is a
3367-
<em>partial</em> <a href="#concept-response" title="concept-response">response</a> in the HTTP cache for
3368-
<var>httpRequest</var>, modify <var>httpRequest</var>'s
3374+
<a href="#concept-request-cache-mode" title="concept-request-cache-mode">cache mode</a> is "<code title="">force-cache</code>", and
3375+
there is a <em>partial</em> <a href="#concept-response" title="concept-response">response</a> in the HTTP cache for
3376+
<var>httpRequest</var>, then modify <var>httpRequest</var>'s
33693377
<a href="#concept-request-header-list" title="concept-request-header-list">header list</a> with resume
33703378
<a href="#concept-header" title="concept-header">headers</a>.
3371-
<!-- XXX xref partial, modify, resume headers -->
3379+
<!-- XXX partial, modify, resume headers -->
33723380

33733381
<li>
33743382
<p>If <var>response</var> is null, run these substeps:

Overview.src.html

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3257,12 +3257,29 @@ <h3>HTTP-network-or-cache fetch</h3>
32573257
<li><p>Let <var>response</var> be null.
32583258

32593259
<li>
3260-
<p>If <var>httpRequest</var>'s
3261-
<span title=concept-request-cache-mode>cache mode</span> is neither
3262-
"<code title>no-store</code>" nor "<code title>reload</code>", and there is a <em>complete</em>
3263-
<span title=concept-response>response</span> in the HTTP cache for
3264-
<var>httpRequest</var> run these substeps:
3265-
<!-- XXX xref "HTTP cache" -->
3260+
<p>If <var>httpRequest</var>'s <span title=concept-request-cache-mode>cache mode</span> is
3261+
"<code title>default</code>", then follow the normal procedures to determine whether the
3262+
HTTP cache has a <span title=concept-response>response</span> for <var>httpRequest</var>.
3263+
3264+
<p class="note">Including taking into account any
3265+
`<code title=http-cache-control>Cache-Control</code>` and `<code title=http-pragma>Pragma</code>`
3266+
<span title=concept-header>headers</span>.
3267+
3268+
<p>If there is such a <span title=concept-response>response</span>, then set <var>response</var>
3269+
to it. Otherwise, if necessary, modify <var>httpRequest</var>'s
3270+
<span title=concept-request-header-list>header list</span> with revalidation or resume
3271+
<span title=concept-header>headers</span>.
3272+
<!-- XXX modify, revalidation headers, resume headers -->
3273+
3274+
<p class="note">Unfortunately this is vaguer than intended. The HTTP cache specification does not
3275+
provide the necessary hooks to make this (or indeed, what follows) crystal clear.
3276+
<!-- XXX HTTP cache -->
3277+
3278+
<li>
3279+
<p>Otherwise, if <var>httpRequest</var>'s <span title=concept-request-cache-mode>cache mode</span>
3280+
is neither "<code title>no-store</code>" nor "<code title>reload</code>", and there is a
3281+
<em>complete</em> <span title=concept-response>response</span> in the HTTP cache for
3282+
<var>httpRequest</var>, then run these substeps:
32663283

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

32773294
<li><p>Otherwise, if <var>httpRequest</var>'s
3278-
<span title=concept-request-cache-mode>cache mode</span> is "<code title>default</code>" and the
3279-
<span title=concept-response>response</span> in the HTTP cache for <var>httpRequest</var> does
3280-
not require revalidation, then set <var>response</var> to that
3281-
<span title=concept-response>response</span>.
3282-
<!-- XXX xref "revalidation" -->
3283-
3284-
<li><p>Otherwise, if <var>httpRequest</var>'s
3285-
<span title=concept-request-cache-mode>cache mode</span> is either "<code title>default</code>"
3286-
or "<code title>no-cache</code>", modify <var>httpRequest</var>'s
3287-
<span title=concept-request-header-list>header list</span> with revalidation
3288-
<span title=concept-header>headers</span>.
3295+
<span title=concept-request-cache-mode>cache mode</span> is "<code title>no-cache</code>", then
3296+
modify <var>httpRequest</var>'s <span title=concept-request-header-list>header list</span> with
3297+
revalidation <span title=concept-header>headers</span>.
32893298
<!-- XXX modify, revalidation headers -->
32903299
</ol>
32913300

32923301
<li><p>Otherwise, if <var>httpRequest</var>'s
3293-
<span title=concept-request-cache-mode>cache mode</span> is either
3294-
"<code title>default</code>" or "<code title>force-cache</code>", and there is a
3295-
<em>partial</em> <span title=concept-response>response</span> in the HTTP cache for
3296-
<var>httpRequest</var>, modify <var>httpRequest</var>'s
3302+
<span title=concept-request-cache-mode>cache mode</span> is "<code title>force-cache</code>", and
3303+
there is a <em>partial</em> <span title=concept-response>response</span> in the HTTP cache for
3304+
<var>httpRequest</var>, then modify <var>httpRequest</var>'s
32973305
<span title=concept-request-header-list>header list</span> with resume
32983306
<span title=concept-header>headers</span>.
3299-
<!-- XXX xref partial, modify, resume headers -->
3307+
<!-- XXX partial, modify, resume headers -->
33003308

33013309
<li>
33023310
<p>If <var>response</var> is null, run these substeps:

0 commit comments

Comments
 (0)