Skip to content

Commit 8b9c16d

Browse files
committed
Drop 'vary' for static resources.
Closes w3c#11. h/t @annevk.
1 parent e3aaff3 commit 8b9c16d

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

index.bs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,11 +325,13 @@ Cross-Origin-Resource-Policy: cross-origin
325325
Timing-Allow-Origin: *</strong>
326326
Content-Security-Policy: sandbox
327327
Cross-Origin-Opener-Policy: same-origin
328-
Vary: Sec-Fetch-Dest, Sec-Fetch-Mode, Sec-Fetch-Site
329328
X-Content-Type-Options: nosniff
330329
X-Frame-Options: DENY
331330
</pre>
332331

332+
Note: Purely static resources always respond with the same data, no matter the request. There's
333+
therefore little benefit to sending a `Vary` header: it can be safely omitted for these responses.
334+
333335
CDNs are the canonical static resource distribution points, and many use the pattern above. Take
334336
a look at the following common resources' response headers for inspiration:
335337

index.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,7 +1486,7 @@
14861486
</style>
14871487
<meta content="Bikeshed version c5172e83, updated Fri Nov 20 15:35:20 2020 -0800" name="generator">
14881488
<link href="https://mikewest.github.io/post-spectre-webdev/" rel="canonical">
1489-
<meta content="00c558cd1a8543faf4012f3cbb56d919c955762f" name="document-revision">
1489+
<meta content="e3aaff3d976a995ec9ab7747397c57d2de6fa5dd" name="document-revision">
14901490
<style>/* style-autolinks */
14911491

14921492
.css.css, .property.property, .descriptor.descriptor {
@@ -2043,7 +2043,7 @@
20432043
<div class="head">
20442044
<p data-fill-with="logo"></p>
20452045
<h1 class="p-name no-ref" id="title">Post-Spectre Web Development</h1>
2046-
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">A Collection of Interesting Ideas, <time class="dt-updated" datetime="2021-02-26">26 February 2021</time></span></h2>
2046+
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">A Collection of Interesting Ideas, <time class="dt-updated" datetime="2021-03-04">4 March 2021</time></span></h2>
20472047
<div data-fill-with="spec-metadata">
20482048
<dl>
20492049
<dt>This version:
@@ -2058,7 +2058,7 @@ <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="cont
20582058
<div data-fill-with="warning"></div>
20592059
<p class="copyright" data-fill-with="copyright"><a href="http://creativecommons.org/publicdomain/zero/1.0/" rel="license"><img alt="CC0" src="https://licensebuttons.net/p/zero/1.0/80x15.png"></a> To the extent possible under law, the editors have waived all copyright
20602060
and related or neighboring rights to this work.
2061-
In addition, as of 26 February 2021,
2061+
In addition, as of 4 March 2021,
20622062
the editors have made this specification available under the <a href="http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0" rel="license">Open Web Foundation Agreement Version 1.0</a>,
20632063
which is available at http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
20642064
Parts of this work may be from another specification document. If so, those parts are instead covered by the license of that specification document. </p>
@@ -2246,10 +2246,11 @@ <h4 class="heading settled" data-level="2.1.1" id="static-subresources"><span cl
22462246
Timing-Allow-Origin: *</strong>
22472247
Content-Security-Policy: sandbox
22482248
Cross-Origin-Opener-Policy: same-origin
2249-
Vary: Sec-Fetch-Dest, Sec-Fetch-Mode, Sec-Fetch-Site
22502249
X-Content-Type-Options: nosniff
22512250
X-Frame-Options: DENY
22522251
</pre>
2252+
<p class="note" role="note"><span>Note:</span> Purely static resources always respond with the same data, no matter the request. There’s
2253+
therefore little benefit to sending a <code>Vary</code> header: it can be safely omitted for these responses.</p>
22532254
<p>CDNs are the canonical static resource distribution points, and many use the pattern above. Take
22542255
a look at the following common resources' response headers for inspiration:</p>
22552256
<ul>

0 commit comments

Comments
 (0)