source: specs/rfc7234.html @ 2736

Last change on this file since 2736 was 2736, checked in by julian.reschke@…, 5 years ago

update rfc2629.xslt

  • Property svn:mime-type set to text/html;charset=iso-8859-1
File size: 174.1 KB
Line 
1
2<!DOCTYPE html
3  PUBLIC "-//W3C//DTD HTML 4.01//EN">
4<html lang="en"><head profile="http://dublincore.org/documents/2008/08/04/dc-html/">
5      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6   <title>Hypertext Transfer Protocol (HTTP/1.1): Caching</title><script type="application/javascript">
7function getMeta(rfcno, container) {
8
9  var xhr = new XMLHttpRequest();
10  xhr.open("GET", "http://tools.ietf.org/draft/rfc" + rfcno + "/state.xml", true);
11  xhr.onload = function (e) {
12    if (xhr.readyState === 4) {
13      if (xhr.status === 200) {
14        var doc = xhr.responseXML;
15        var info = getChildByName(doc.documentElement, "info");
16 
17        var cont = document.getElementById(container);
18        // empty the container
19        while (cont.firstChild) {
20          cont.removeChild(myNode.firstChild);
21        }     
22 
23        var c = getChildByName(info, "stdstatus");
24        if (c !== null) {
25          var bld = newElementWithText("b", c.textContent);
26          cont.appendChild(bld);
27        }
28 
29        c = getChildByName(info, "updatedby");
30        if (c !== null) {
31          cont.appendChild(newElement("br"));
32          cont.appendChild(newText("Updated by: "));
33          appendRfcLinks(cont, c.textContent);
34        }
35 
36        c = getChildByName(info, "obsoletedby");
37        if (c !== null) {
38          cont.appendChild(newElement("br"));
39          cont.appendChild(newText("Obsoleted by: "));
40          appendRfcLinks(cont, c.textContent);
41        }
42       
43        c = getChildByName(info, "errata");
44        if (c !== null) {
45          cont.appendChild(newElement("br"));
46          var link = newElementWithText("a", "errata");
47          link.setAttribute("href", "http://www.rfc-editor.org/errata_search.php?rfc=" + rfcno);
48          var errata = newElementWithText("i", "This document has ");
49          errata.appendChild(link);
50          errata.appendChild(newText("."));
51          cont.appendChild(errata);
52        }
53
54        cont.style.display = "block";
55      } else {
56        console.error(xhr.statusText);
57      }
58    }
59  };
60  xhr.onerror = function (e) {
61    console.error(xhr.status + " " + xhr.statusText);
62  };
63  xhr.send(null);
64}
65
66// DOM helpers
67function newElement(name) {
68  return document.createElement(name);
69}
70function newElementWithText(name, txt) {
71  var e = document.createElement(name);
72  e.appendChild(newText(txt));
73  return e;
74}
75function newText(text) {
76  return document.createTextNode(text);
77}
78
79function getChildByName(parent, name) {
80  if (parent === null) {
81    return null;
82  }
83  else {
84    for (var c = parent.firstChild; c !== null; c = c.nextSibling) {
85      if (name == c.nodeName) {
86        return c;
87      }
88    }
89    return null;
90  }
91}
92
93function appendRfcLinks(parent, text) {
94  var updates = text.split(",");
95  for (var i = 0; i < updates.length; i++) {
96    var rfc = updates[i].trim();
97    if (rfc.substring(0, 3) == "rfc") {
98      var link = newElement("a");
99      link.setAttribute("href", "http://tools.ietf.org/html/" + rfc);
100      link.appendChild(newText(rfc.substring(3)));
101      parent.appendChild(link);
102    } else {
103      parent.appendChild(newText(rfc));
104    }
105    if (i != updates.length - 1) {
106      parent.appendChild(newText(", "));
107    }
108  }
109}
110</script><style type="text/css" title="Xml2Rfc (sans serif)">
111a {
112  text-decoration: none;
113}
114a.smpl {
115  color: black;
116}
117a:hover {
118  text-decoration: underline;
119}
120a:active {
121  text-decoration: underline;
122}
123address {
124  margin-top: 1em;
125  margin-left: 2em;
126  font-style: normal;
127}
128body {
129  color: black;
130  font-family: cambria, georgia, serif;
131  font-size: 12pt;
132  margin: 2em auto;
133  max-width: 1000px;
134}
135samp, tt, code, pre {
136  font-family: consolas, monaco, monospace;
137}
138cite {
139  font-style: normal;
140}
141div.note {
142  margin-left: 2em;
143}
144dl {
145  margin-left: 2em;
146}
147dl > dt {
148  float: left;
149  margin-right: 1em;
150}
151dl.nohang > dt {
152  float: none;
153}
154dl > dd {
155  margin-bottom: .5em;
156}
157dl.compact > dd {
158  margin-bottom: .0em;
159}
160dl > dd > dl {
161  margin-top: 0.5em;
162}
163ul.empty {
164  list-style-type: none;
165}
166ul.empty li {
167  margin-top: .5em;
168}
169dl p {
170  margin-left: 0em;
171}
172h1 {
173  font-size: 130%;
174  line-height: 21pt;
175  page-break-after: avoid;
176}
177h1.np {
178  page-break-before: always;
179}
180h2 {
181  font-size: 120%;
182  line-height: 15pt;
183  page-break-after: avoid;
184}
185h3 {
186  font-size: 110%;
187  page-break-after: avoid;
188}
189h4, h5, h6 {
190  page-break-after: avoid;
191}
192h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
193  color: black;
194}
195img {
196  margin-left: 3em;
197}
198li {
199  margin-left: 2em;
200}
201ol {
202  margin-left: 2em;
203}
204ol.la {
205  list-style-type: lower-alpha;
206}
207ol.ua {
208  list-style-type: upper-alpha;
209}
210ol p {
211  margin-left: 0em;
212}
213p {
214  margin-left: 2em;
215}
216pre {
217  font-size: 11pt;
218  margin-left: 3em;
219  background-color: lightyellow;
220  padding: .25em;
221  page-break-inside: avoid;
222}
223pre.text2 {
224  border-style: dotted;
225  border-width: 1px;
226  background-color: #f0f0f0;
227}
228pre.inline {
229  background-color: white;
230  padding: 0em;
231  page-break-inside: auto;
232}
233pre.text {
234  border-style: dotted;
235  border-width: 1px;
236  background-color: #f8f8f8;
237}
238pre.drawing {
239  border-style: solid;
240  border-width: 1px;
241  background-color: #f8f8f8;
242  padding: 2em;
243}
244sup {
245  font-size: 60%;
246}
247table {
248  margin-left: 2em;
249}
250table.tt {
251  vertical-align: top;
252  border-color: gray;
253}
254table.tt th {
255  border-color: gray;
256}
257table.tt td {
258  border-color: gray;
259}
260table.all {
261  border-style: solid;
262  border-width: 2px;
263}
264table.full {
265  border-style: solid;
266  border-width: 2px;
267}
268table.tt td {
269  vertical-align: top;
270}
271table.all td {
272  border-style: solid;
273  border-width: 1px;
274}
275table.full td {
276  border-style: none solid;
277  border-width: 1px;
278}
279table.tt th {
280  vertical-align: top;
281}
282table.all th {
283  border-style: solid;
284  border-width: 1px;
285}
286table.full th {
287  border-style: solid;
288  border-width: 1px 1px 2px 1px;
289}
290table.headers th {
291  border-style: none none solid none;
292  border-width: 2px;
293}
294table.left {
295  margin-right: auto;
296}
297table.right {
298  margin-left: auto;
299}
300table.center {
301  margin-left: auto;
302  margin-right: auto;
303}
304caption {
305  caption-side: bottom;
306  font-weight: bold;
307  font-size: 10pt;
308  margin-top: .5em;
309}
310
311table.header {
312  border-spacing: 1px;
313  width: 95%;
314  font-size: 11pt;
315  color: white;
316}
317td.top {
318  vertical-align: top;
319}
320td.topnowrap {
321  vertical-align: top;
322  white-space: nowrap;
323}
324table.header td {
325  background-color: gray;
326  width: 50%;
327}
328table.header a {
329  color: white;
330}
331td.reference {
332  vertical-align: top;
333  white-space: nowrap;
334  padding-right: 1em;
335}
336thead {
337  display:table-header-group;
338}
339ul.toc, ul.toc ul {
340  list-style: none;
341  margin-left: 1.5em;
342  padding-left: 0em;
343}
344ul.toc li {
345  line-height: 150%;
346  font-weight: bold;
347  margin-left: 0em;
348}
349ul.toc li li {
350  line-height: normal;
351  font-weight: normal;
352  font-size: 11pt;
353  margin-left: 0em;
354}
355li.excluded {
356  font-size: 0pt;
357}
358ul p {
359  margin-left: 0em;
360}
361.title, .filename, h1, h2, h3, h4 {
362  font-family: candara, calibri, segoe, optima, arial, sans-serif;
363}
364ul.ind, ul.ind ul {
365  list-style: none;
366  margin-left: 1.5em;
367  padding-left: 0em;
368  page-break-before: avoid;
369}
370ul.ind li {
371  font-weight: bold;
372  line-height: 200%;
373  margin-left: 0em;
374}
375ul.ind li li {
376  font-weight: normal;
377  line-height: 150%;
378  margin-left: 0em;
379}
380.avoidbreakinside {
381  page-break-inside: avoid;
382}
383.avoidbreakafter {
384  page-break-after: avoid;
385}
386.bcp14 {
387  font-style: normal;
388  text-transform: lowercase;
389  font-variant: small-caps;
390}
391.comment {
392  background-color: yellow;
393}
394.center {
395  text-align: center;
396}
397.error {
398  color: red;
399  font-style: italic;
400  font-weight: bold;
401}
402.figure {
403  font-weight: bold;
404  text-align: center;
405  font-size: 10pt;
406}
407.filename {
408  color: #333333;
409  font-size: 75%;
410  font-weight: bold;
411  line-height: 21pt;
412  text-align: center;
413}
414.fn {
415  font-weight: bold;
416}
417.left {
418  text-align: left;
419}
420.right {
421  text-align: right;
422}
423.title {
424  color: green;
425  font-size: 150%;
426  line-height: 18pt;
427  font-weight: bold;
428  text-align: center;
429  margin-top: 36pt;
430}
431.warning {
432  font-size: 130%;
433  background-color: yellow;
434}
435.self {
436    color: #999999;
437    margin-left: .3em;
438    text-decoration: none;
439    visibility: hidden;
440    -webkit-user-select: none;
441    -moz-user-select: none;
442    -ms-user-select: none;
443}
444.self:hover {
445    text-decoration: none;
446}
447p:hover .self {
448    visibility: visible;
449}
450
451@media screen {
452  pre.text, pre.text2 {
453    width: 69em;
454  }
455}
456
457@media print {
458  .noprint {
459    display: none;
460  }
461
462  a {
463    color: black;
464    text-decoration: none;
465  }
466
467  table.header {
468    width: 90%;
469  }
470
471  td.header {
472    width: 50%;
473    color: black;
474    background-color: white;
475    vertical-align: top;
476    font-size: 110%;
477  }
478
479  ul.toc a:last-child::after {
480    content: leader('.') target-counter(attr(href), page);
481  }
482
483  ul.ind li li a {
484    content: target-counter(attr(href), page);
485  }
486
487  pre {
488    font-size: 10pt;
489  }
490
491  .print2col {
492    column-count: 2;
493    -moz-column-count: 2;
494    column-fill: auto;
495  }
496}
497
498@page {
499  @top-left {
500       content: "RFC 7234";
501  }
502  @top-right {
503       content: "June 2014";
504  }
505  @top-center {
506       content: "HTTP/1.1 Caching";
507  }
508  @bottom-left {
509       content: "Fielding, et al.";
510  }
511  @bottom-center {
512       content: "Standards Track";
513  }
514  @bottom-right {
515       content: "[Page " counter(page) "]";
516  }
517}
518
519@page:first {
520    @top-left {
521      content: normal;
522    }
523    @top-right {
524      content: normal;
525    }
526    @top-center {
527      content: normal;
528    }
529}
530</style><link rel="Contents" href="#rfc.toc"><link rel="Author" href="#rfc.authors"><link rel="Copyright" href="#rfc.copyrightnotice"><link rel="Index" href="#rfc.index"><link rel="Chapter" title="1 Introduction" href="#rfc.section.1"><link rel="Chapter" title="2 Overview of Cache Operation" href="#rfc.section.2"><link rel="Chapter" title="3 Storing Responses in Caches" href="#rfc.section.3"><link rel="Chapter" title="4 Constructing Responses from Caches" href="#rfc.section.4"><link rel="Chapter" title="5 Header Field Definitions" href="#rfc.section.5"><link rel="Chapter" title="6 History Lists" href="#rfc.section.6"><link rel="Chapter" title="7 IANA Considerations" href="#rfc.section.7"><link rel="Chapter" title="8 Security Considerations" href="#rfc.section.8"><link rel="Chapter" title="9 Acknowledgments" href="#rfc.section.9"><link rel="Chapter" href="#rfc.section.10" title="10 References"><link rel="Appendix" title="A Changes from RFC 2616" href="#rfc.section.A"><link rel="Appendix" title="B Imported ABNF" href="#rfc.section.B"><link rel="Appendix" title="C Collected ABNF" href="#rfc.section.C"><link href="rfc7233.html" rel="prev"><link href="rfc7235.html" rel="next"><link rel="Alternate" title="Authoritative ASCII Version" href="http://www.ietf.org/rfc/rfc7234.txt"><link rel="Help" title="RFC-Editor's Status Page" href="http://www.rfc-editor.org/info/rfc7234"><link rel="Help" title="Additional Information on tools.ietf.org" href="http://tools.ietf.org/html/rfc7234"><meta name="generator" content="http://greenbytes.de/tech/webdav/rfc2629.xslt, Revision 1.717, 2015/03/23 17:14:43, XSLT vendor: SAXON 6.5.5 from Michael Kay http://saxon.sf.net/"><meta name="keywords" content="Hypertext Transfer Protocol, HTTP, HTTP Caching"><link rel="schema.dct" href="http://purl.org/dc/terms/"><meta name="dct.creator" content="Fielding, R."><meta name="dct.creator" content="Nottingham, M."><meta name="dct.creator" content="Reschke, J. F."><meta name="dct.identifier" content="urn:ietf:rfc:7234"><meta name="dct.issued" scheme="ISO8601" content="2014-06"><meta name="dct.replaces" content="urn:ietf:rfc:2616"><meta name="dct.abstract" content="The Hypertext Transfer Protocol (HTTP) is a stateless application-level protocol for distributed, collaborative, hypertext information systems. This document defines HTTP caches and the associated header fields that control cache behavior or indicate cacheable response messages."><meta name="dct.isPartOf" content="urn:issn:2070-1721"><meta name="description" content="The Hypertext Transfer Protocol (HTTP) is a stateless application-level protocol for distributed, collaborative, hypertext information systems. This document defines HTTP caches and the associated header fields that control cache behavior or indicate cacheable response messages."></head><body onload="getMeta(7234,&#34;rfc.meta&#34;);"><table class="header" id="rfc.headerblock"><tbody><tr><td class="left">Internet Engineering Task Force (IETF)</td><td class="right">R. Fielding, Editor</td></tr><tr><td class="left">Request for Comments: 7234</td><td class="right">Adobe</td></tr><tr><td class="left">Obsoletes: <a href="https://tools.ietf.org/html/rfc2616">2616</a></td><td class="right">M. Nottingham, Editor</td></tr><tr><td class="left">Category: Standards Track</td><td class="right">Akamai</td></tr><tr><td class="left">ISSN: 2070-1721</td><td class="right">J. Reschke, Editor</td></tr><tr><td class="left"></td><td class="right">greenbytes</td></tr><tr><td class="left"></td><td class="right">June 2014</td></tr></tbody></table><p class="title" id="rfc.title">Hypertext Transfer Protocol (HTTP/1.1): Caching</p><h1 id="rfc.abstract"><a href="#rfc.abstract">Abstract</a></h1><p>The Hypertext Transfer Protocol (HTTP) is a stateless application-level protocol for distributed, collaborative, hypertext information systems. This document defines HTTP caches and the associated header fields that control cache behavior or indicate cacheable response messages.</p><div id="rfc.meta" style="float: right; border: 1px solid black; margin: 2em; padding: 1em; display: none;"></div><div id="rfc.status"><h1><a href="#rfc.status">Status of This Memo</a></h1><p>This is an Internet Standards Track document.</p><p>This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 5741.</p><p>Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at <a href="http://www.rfc-editor.org/info/rfc7234">http://www.rfc-editor.org/info/rfc7234</a>.</p></div><div id="rfc.copyrightnotice"><h1><a href="#rfc.copyrightnotice">Copyright Notice</a></h1><p>Copyright &copy; 2014 IETF Trust and the persons identified as the document authors. All rights reserved.</p><p>This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.</p><p>This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English.</p></div><hr class="noprint"><div id="rfc.toc"><h1 class="np"><a href="#rfc.toc">Table of Contents</a></h1><ul class="toc"><li><a href="#rfc.section.1">1.</a>&nbsp;&nbsp;&nbsp;<a href="#caching">Introduction</a><ul><li><a href="#rfc.section.1.1">1.1</a>&nbsp;&nbsp;&nbsp;<a href="#conformance">Conformance and Error Handling</a></li><li><a href="#rfc.section.1.2">1.2</a>&nbsp;&nbsp;&nbsp;<a href="#notation">Syntax Notation</a><ul><li><a href="#rfc.section.1.2.1">1.2.1</a>&nbsp;&nbsp;&nbsp;<a href="#delta-seconds">Delta Seconds</a></li></ul></li></ul></li><li><a href="#rfc.section.2">2.</a>&nbsp;&nbsp;&nbsp;<a href="#caching.overview">Overview of Cache Operation</a></li><li><a href="#rfc.section.3">3.</a>&nbsp;&nbsp;&nbsp;<a href="#response.cacheability">Storing Responses in Caches</a><ul><li><a href="#rfc.section.3.1">3.1</a>&nbsp;&nbsp;&nbsp;<a href="#incomplete.responses">Storing Incomplete Responses</a></li><li><a href="#rfc.section.3.2">3.2</a>&nbsp;&nbsp;&nbsp;<a href="#caching.authenticated.responses">Storing Responses to Authenticated Requests</a></li><li><a href="#rfc.section.3.3">3.3</a>&nbsp;&nbsp;&nbsp;<a href="#combining.responses">Combining Partial Content</a></li></ul></li><li><a href="#rfc.section.4">4.</a>&nbsp;&nbsp;&nbsp;<a href="#constructing.responses.from.caches">Constructing Responses from Caches</a><ul><li><a href="#rfc.section.4.1">4.1</a>&nbsp;&nbsp;&nbsp;<a href="#caching.negotiated.responses">Calculating Secondary Keys with Vary</a></li><li><a href="#rfc.section.4.2">4.2</a>&nbsp;&nbsp;&nbsp;<a href="#expiration.model">Freshness</a><ul><li><a href="#rfc.section.4.2.1">4.2.1</a>&nbsp;&nbsp;&nbsp;<a href="#calculating.freshness.lifetime">Calculating Freshness Lifetime</a></li><li><a href="#rfc.section.4.2.2">4.2.2</a>&nbsp;&nbsp;&nbsp;<a href="#heuristic.freshness">Calculating Heuristic Freshness</a></li><li><a href="#rfc.section.4.2.3">4.2.3</a>&nbsp;&nbsp;&nbsp;<a href="#age.calculations">Calculating Age</a></li><li><a href="#rfc.section.4.2.4">4.2.4</a>&nbsp;&nbsp;&nbsp;<a href="#serving.stale.responses">Serving Stale Responses</a></li></ul></li><li><a href="#rfc.section.4.3">4.3</a>&nbsp;&nbsp;&nbsp;<a href="#validation.model">Validation</a><ul><li><a href="#rfc.section.4.3.1">4.3.1</a>&nbsp;&nbsp;&nbsp;<a href="#validation.sent">Sending a Validation Request</a></li><li><a href="#rfc.section.4.3.2">4.3.2</a>&nbsp;&nbsp;&nbsp;<a href="#validation.received">Handling a Received Validation Request</a></li><li><a href="#rfc.section.4.3.3">4.3.3</a>&nbsp;&nbsp;&nbsp;<a href="#validation.response">Handling a Validation Response</a></li><li><a href="#rfc.section.4.3.4">4.3.4</a>&nbsp;&nbsp;&nbsp;<a href="#freshening.responses">Freshening Stored Responses upon Validation</a></li><li><a href="#rfc.section.4.3.5">4.3.5</a>&nbsp;&nbsp;&nbsp;<a href="#head.effects">Freshening Responses via HEAD</a></li></ul></li><li><a href="#rfc.section.4.4">4.4</a>&nbsp;&nbsp;&nbsp;<a href="#invalidation">Invalidation</a></li></ul></li><li><a href="#rfc.section.5">5.</a>&nbsp;&nbsp;&nbsp;<a href="#header.field.definitions">Header Field Definitions</a><ul><li><a href="#rfc.section.5.1">5.1</a>&nbsp;&nbsp;&nbsp;<a href="#header.age">Age</a></li><li><a href="#rfc.section.5.2">5.2</a>&nbsp;&nbsp;&nbsp;<a href="#header.cache-control">Cache-Control</a><ul><li><a href="#rfc.section.5.2.1">5.2.1</a>&nbsp;&nbsp;&nbsp;<a href="#cache-request-directive">Request Cache-Control Directives</a></li><li><a href="#rfc.section.5.2.2">5.2.2</a>&nbsp;&nbsp;&nbsp;<a href="#cache-response-directive">Response Cache-Control Directives</a></li><li><a href="#rfc.section.5.2.3">5.2.3</a>&nbsp;&nbsp;&nbsp;<a href="#cache.control.extensions">Cache Control Extensions</a></li></ul></li><li><a href="#rfc.section.5.3">5.3</a>&nbsp;&nbsp;&nbsp;<a href="#header.expires">Expires</a></li><li><a href="#rfc.section.5.4">5.4</a>&nbsp;&nbsp;&nbsp;<a href="#header.pragma">Pragma</a></li><li><a href="#rfc.section.5.5">5.5</a>&nbsp;&nbsp;&nbsp;<a href="#header.warning">Warning</a><ul><li><a href="#rfc.section.5.5.1">5.5.1</a>&nbsp;&nbsp;&nbsp;<a href="#warn.110">Warning: 110 - "Response is Stale"</a></li><li><a href="#rfc.section.5.5.2">5.5.2</a>&nbsp;&nbsp;&nbsp;<a href="#warn.111">Warning: 111 - "Revalidation Failed"</a></li><li><a href="#rfc.section.5.5.3">5.5.3</a>&nbsp;&nbsp;&nbsp;<a href="#warn.112">Warning: 112 - "Disconnected Operation"</a></li><li><a href="#rfc.section.5.5.4">5.5.4</a>&nbsp;&nbsp;&nbsp;<a href="#warn.113">Warning: 113 - "Heuristic Expiration"</a></li><li><a href="#rfc.section.5.5.5">5.5.5</a>&nbsp;&nbsp;&nbsp;<a href="#warn.199">Warning: 199 - "Miscellaneous Warning"</a></li><li><a href="#rfc.section.5.5.6">5.5.6</a>&nbsp;&nbsp;&nbsp;<a href="#warn.214">Warning: 214 - "Transformation Applied"</a></li><li><a href="#rfc.section.5.5.7">5.5.7</a>&nbsp;&nbsp;&nbsp;<a href="#warn.299">Warning: 299 - "Miscellaneous Persistent Warning"</a></li></ul></li></ul></li><li><a href="#rfc.section.6">6.</a>&nbsp;&nbsp;&nbsp;<a href="#history.lists">History Lists</a></li><li><a href="#rfc.section.7">7.</a>&nbsp;&nbsp;&nbsp;<a href="#iana.considerations">IANA Considerations</a><ul><li><a href="#rfc.section.7.1">7.1</a>&nbsp;&nbsp;&nbsp;<a href="#cache.directive.registry">Cache Directive Registry</a><ul><li><a href="#rfc.section.7.1.1">7.1.1</a>&nbsp;&nbsp;&nbsp;<a href="#cache.directive.registry.procedure">Procedure</a></li><li><a href="#rfc.section.7.1.2">7.1.2</a>&nbsp;&nbsp;&nbsp;<a href="#cache.directive.considerations">Considerations for New Cache Control Directives</a></li><li><a href="#rfc.section.7.1.3">7.1.3</a>&nbsp;&nbsp;&nbsp;<a href="#cache.directive.registration">Registrations</a></li></ul></li><li><a href="#rfc.section.7.2">7.2</a>&nbsp;&nbsp;&nbsp;<a href="#warn.code.registry">Warn Code Registry</a><ul><li><a href="#rfc.section.7.2.1">7.2.1</a>&nbsp;&nbsp;&nbsp;<a href="#warn.code.registry.procedure">Procedure</a></li><li><a href="#rfc.section.7.2.2">7.2.2</a>&nbsp;&nbsp;&nbsp;<a href="#warn.code.registration">Registrations</a></li></ul></li><li><a href="#rfc.section.7.3">7.3</a>&nbsp;&nbsp;&nbsp;<a href="#header.field.registration">Header Field Registration</a></li></ul></li><li><a href="#rfc.section.8">8.</a>&nbsp;&nbsp;&nbsp;<a href="#security.considerations">Security Considerations</a></li><li><a href="#rfc.section.9">9.</a>&nbsp;&nbsp;&nbsp;<a href="#acks">Acknowledgments</a></li><li><a href="#rfc.section.10">10.</a>&nbsp;&nbsp;&nbsp;<a href="#rfc.references">References</a><ul><li><a href="#rfc.section.10.1">10.1</a>&nbsp;&nbsp;&nbsp;<a href="#rfc.references.1">Normative References</a></li><li><a href="#rfc.section.10.2">10.2</a>&nbsp;&nbsp;&nbsp;<a href="#rfc.references.2">Informative References</a></li></ul></li><li><a href="#rfc.section.A">A.</a>&nbsp;&nbsp;&nbsp;<a href="#changes.from.rfc.2616">Changes from RFC 2616</a></li><li><a href="#rfc.section.B">B.</a>&nbsp;&nbsp;&nbsp;<a href="#imported.abnf">Imported ABNF</a></li><li><a href="#rfc.section.C">C.</a>&nbsp;&nbsp;&nbsp;<a href="#collected.abnf">Collected ABNF</a></li><li><a href="#rfc.index">Index</a></li><li><a href="#rfc.authors">Authors' Addresses</a></li></ul></div><div id="caching"><h1 id="rfc.section.1" class="np"><a href="#rfc.section.1">1.</a>&nbsp;<a href="#caching">Introduction</a></h1><div id="rfc.section.1.p.1"><p>HTTP is typically used for distributed information systems, where performance can be improved by the use of response caches. This document defines aspects of HTTP/1.1 related to caching and reusing response messages.<a class="self" href="#rfc.section.1.p.1">&para;</a></p></div><div id="rfc.iref.c.1"></div><div id="rfc.section.1.p.2"><p>An HTTP <dfn>cache</dfn> is a local store of response messages and the subsystem that controls storage, retrieval, and deletion of messages in it. A cache stores cacheable responses in order to reduce the response time and network bandwidth consumption on future, equivalent requests. Any client or server <em class="bcp14">MAY</em> employ a cache, though a cache cannot be used by a server that is acting as a tunnel.<a class="self" href="#rfc.section.1.p.2">&para;</a></p></div><div id="rfc.iref.s.1"></div><div id="rfc.iref.p.1"></div><div id="shared.and.private.caches"><div id="rfc.section.1.p.3"><p>A <dfn>shared cache</dfn> is a cache that stores responses to be reused by more than one user; shared caches are usually (but not always) deployed as a part of an intermediary. A <dfn>private cache</dfn>, in contrast, is dedicated to a single user; often, they are deployed as a component of a user agent.<a class="self" href="#rfc.section.1.p.3">&para;</a></p></div></div><div id="rfc.section.1.p.4"><p>The goal of caching in HTTP/1.1 is to significantly improve performance by reusing a prior response message to satisfy a current request. A stored response is considered "fresh", as defined in <a href="#expiration.model" title="Freshness">Section&nbsp;4.2</a>, if the response can be reused without "validation" (checking with the origin server to see if the cached response remains valid for this request). A fresh response can therefore reduce both latency and network overhead each time it is reused. When a cached response is not fresh, it might still be reusable if it can be freshened by validation (<a href="#validation.model" title="Validation">Section&nbsp;4.3</a>) or if the origin is unavailable (<a href="#serving.stale.responses" title="Serving Stale Responses">Section&nbsp;4.2.4</a>).<a class="self" href="#rfc.section.1.p.4">&para;</a></p></div><div id="conformance"><h2 id="rfc.section.1.1"><a href="#rfc.section.1.1">1.1</a>&nbsp;<a href="#conformance">Conformance and Error Handling</a></h2><div id="rfc.section.1.1.p.1"><p>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in <a href="#RFC2119" id="rfc.xref.RFC2119.1"><cite title="Key words for use in RFCs to Indicate Requirement Levels">[RFC2119]</cite></a>.<a class="self" href="#rfc.section.1.1.p.1">&para;</a></p></div><div id="rfc.section.1.1.p.2"><p>Conformance criteria and considerations regarding error handling are defined in <a href="rfc7230.html#conformance" title="Conformance and Error Handling">Section 2.5</a> of <a href="#RFC7230" id="rfc.xref.RFC7230.1"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a>.<a class="self" href="#rfc.section.1.1.p.2">&para;</a></p></div></div><div id="notation"><h2 id="rfc.section.1.2"><a href="#rfc.section.1.2">1.2</a>&nbsp;<a href="#notation">Syntax Notation</a></h2><div id="rfc.section.1.2.p.1"><p>This specification uses the Augmented Backus-Naur Form (ABNF) notation of <a href="#RFC5234" id="rfc.xref.RFC5234.1"><cite title="Augmented BNF for Syntax Specifications: ABNF">[RFC5234]</cite></a> with a list extension, defined in <a href="rfc7230.html#abnf.extension" title="ABNF List Extension: #rule">Section 7</a> of <a href="#RFC7230" id="rfc.xref.RFC7230.2"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a>, that allows for compact definition of comma-separated lists using a '#' operator (similar to how the '*' operator indicates repetition). <a href="#imported.abnf" title="Imported ABNF">Appendix&nbsp;B</a> describes rules imported from other documents. <a href="#collected.abnf" title="Collected ABNF">Appendix&nbsp;C</a> shows the collected grammar with all list operators expanded to standard ABNF notation.<a class="self" href="#rfc.section.1.2.p.1">&para;</a></p></div><div id="delta-seconds"><h3 id="rfc.section.1.2.1"><a href="#rfc.section.1.2.1">1.2.1</a>&nbsp;<a href="#delta-seconds">Delta Seconds</a></h3><div id="rfc.section.1.2.1.p.1"><p>The delta-seconds rule specifies a non-negative integer, representing time in seconds.<a class="self" href="#rfc.section.1.2.1.p.1">&para;</a></p></div><div id="rfc.figure.u.1"><pre class="inline"><span id="rfc.iref.g.1"></span>  <a href="#delta-seconds" class="smpl">delta-seconds</a>  = 1*<a href="#imported.abnf" class="smpl">DIGIT</a>
531</pre></div><div id="rfc.section.1.2.1.p.2"><p>A recipient parsing a delta-seconds value and converting it to binary form ought to use an arithmetic type of at least 31 bits of non-negative integer range. If a cache receives a delta-seconds value greater than the greatest integer it can represent, or if any of its subsequent calculations overflows, the cache <em class="bcp14">MUST</em> consider the value to be either 2147483648 (2<sup>31</sup>) or the greatest positive integer it can conveniently represent.<a class="self" href="#rfc.section.1.2.1.p.2">&para;</a></p></div><div class="note"><div id="rfc.section.1.2.1.p.3"><p><b>Note:</b> The value 2147483648 is here for historical reasons, effectively represents infinity (over 68 years), and does not need to be stored in binary form; an implementation could produce it as a canned string if any overflow occurs, even if the calculations are performed with an arithmetic type incapable of directly representing that number. What matters here is that an overflow be detected and not treated as a negative value in later calculations.<a class="self" href="#rfc.section.1.2.1.p.3">&para;</a></p></div></div></div></div></div><div id="caching.overview"><h1 id="rfc.section.2"><a href="#rfc.section.2">2.</a>&nbsp;<a href="#caching.overview">Overview of Cache Operation</a></h1><div id="rfc.section.2.p.1"><p>Proper cache operation preserves the semantics of HTTP transfers (<a href="#RFC7231" id="rfc.xref.RFC7231.1"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[RFC7231]</cite></a>) while eliminating the transfer of information already held in the cache. Although caching is an entirely <em class="bcp14">OPTIONAL</em> feature of HTTP, it can be assumed that reusing a cached response is desirable and that such reuse is the default behavior when no requirement or local configuration prevents it. Therefore, HTTP cache requirements are focused on preventing a cache from either storing a non-reusable response or reusing a stored response inappropriately, rather than mandating that caches always store and reuse particular responses.<a class="self" href="#rfc.section.2.p.1">&para;</a></p></div><div id="rfc.section.2.p.2"><p>Each <dfn>cache entry</dfn> consists of a cache key and one or more HTTP responses corresponding to prior requests that used the same key. The most common form of cache entry is a successful result of a retrieval request: i.e., a <a href="rfc7231.html#status.200" class="smpl">200 (OK)</a> response to a GET request, which contains a representation of the resource identified by the request target (<a href="rfc7231.html#GET" title="GET">Section 4.3.1</a> of <a href="#RFC7231" id="rfc.xref.RFC7231.2"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[RFC7231]</cite></a>). However, it is also possible to cache permanent redirects, negative results (e.g., <a href="rfc7231.html#status.404" class="smpl">404 (Not Found)</a>), incomplete results (e.g., <a href="rfc7233.html#status.206" class="smpl">206 (Partial Content)</a>), and responses to methods other than GET if the method's definition allows such caching and defines something suitable for use as a cache key.<a class="self" href="#rfc.section.2.p.2">&para;</a></p></div><div id="rfc.iref.c.2"></div><div id="rfc.section.2.p.3"><p>The primary <dfn>cache key</dfn> consists of the request method and target URI. However, since HTTP caches in common use today are typically limited to caching responses to GET, many caches simply decline other methods and use only the URI as the primary cache key.<a class="self" href="#rfc.section.2.p.3">&para;</a></p></div><div id="rfc.section.2.p.4"><p>If a request target is subject to content negotiation, its cache entry might consist of multiple stored responses, each differentiated by a secondary key for the values of the original request's selecting header fields (<a href="#caching.negotiated.responses" title="Calculating Secondary Keys with Vary">Section&nbsp;4.1</a>).<a class="self" href="#rfc.section.2.p.4">&para;</a></p></div></div><div id="response.cacheability"><h1 id="rfc.section.3"><a href="#rfc.section.3">3.</a>&nbsp;<a href="#response.cacheability">Storing Responses in Caches</a></h1><div id="rfc.section.3.p.1"><p>A cache <em class="bcp14">MUST NOT</em> store a response to any request, unless: <a class="self" href="#rfc.section.3.p.1">&para;</a></p><ul><li>The request method is understood by the cache and defined as being cacheable, and</li><li>the response status code is understood by the cache, and</li><li>the "no-store" cache directive (see <a href="#header.cache-control" id="rfc.xref.header.cache-control.1" title="Cache-Control">Section&nbsp;5.2</a>) does not appear in request or response header fields, and</li><li>the "private" response directive (see <a href="#cache-response-directive.private" title="private">Section&nbsp;5.2.2.6</a>) does not appear in the response, if the cache is shared, and</li><li>the <a href="rfc7235.html#header.authorization" class="smpl">Authorization</a> header field (see <a href="rfc7235.html#header.authorization" title="Authorization">Section 4.2</a> of <a href="#RFC7235" id="rfc.xref.RFC7235.1"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Authentication">[RFC7235]</cite></a>) does not appear in the request, if the cache is shared, unless the response explicitly allows it (see <a href="#caching.authenticated.responses" title="Storing Responses to Authenticated Requests">Section&nbsp;3.2</a>), and</li><li>the response either: <ul><li>contains an <a href="#header.expires" class="smpl">Expires</a> header field (see <a href="#header.expires" id="rfc.xref.header.expires.1" title="Expires">Section&nbsp;5.3</a>), or</li><li>contains a max-age response directive (see <a href="#cache-response-directive.max-age" title="max-age">Section&nbsp;5.2.2.8</a>), or</li><li>contains a s-maxage response directive (see <a href="#cache-response-directive.s-maxage" title="s-maxage">Section&nbsp;5.2.2.9</a>) and the cache is shared, or</li><li>contains a Cache Control Extension (see <a href="#cache.control.extensions" title="Cache Control Extensions">Section&nbsp;5.2.3</a>) that allows it to be cached, or</li><li>has a status code that is defined as cacheable by default (see <a href="#heuristic.freshness" title="Calculating Heuristic Freshness">Section&nbsp;4.2.2</a>), or</li><li>contains a public response directive (see <a href="#cache-response-directive.public" title="public">Section&nbsp;5.2.2.5</a>).</li></ul> </li></ul></div><div id="rfc.section.3.p.2"><p>Note that any of the requirements listed above can be overridden by a cache-control extension; see <a href="#cache.control.extensions" title="Cache Control Extensions">Section&nbsp;5.2.3</a>.<a class="self" href="#rfc.section.3.p.2">&para;</a></p></div><div id="rfc.section.3.p.3"><p>In this context, a cache has "understood" a request method or a response status code if it recognizes it and implements all specified caching-related behavior.<a class="self" href="#rfc.section.3.p.3">&para;</a></p></div><div id="rfc.section.3.p.4"><p>Note that, in normal operation, some caches will not store a response that has neither a cache validator nor an explicit expiration time, as such responses are not usually useful to store. However, caches are not prohibited from storing such responses.<a class="self" href="#rfc.section.3.p.4">&para;</a></p></div><div id="incomplete.responses"><h2 id="rfc.section.3.1"><a href="#rfc.section.3.1">3.1</a>&nbsp;<a href="#incomplete.responses">Storing Incomplete Responses</a></h2><div id="rfc.section.3.1.p.1"><p>A response message is considered complete when all of the octets indicated by the message framing (<a href="#RFC7230" id="rfc.xref.RFC7230.3"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a>) are received prior to the connection being closed. If the request method is GET, the response status code is <a href="rfc7231.html#status.200" class="smpl">200 (OK)</a>, and the entire response header section has been received, a cache <em class="bcp14">MAY</em> store an incomplete response message body if the cache entry is recorded as incomplete. Likewise, a <a href="rfc7233.html#status.206" class="smpl">206 (Partial Content)</a> response <em class="bcp14">MAY</em> be stored as if it were an incomplete <a href="rfc7231.html#status.200" class="smpl">200
532   (OK)</a> cache entry. However, a cache <em class="bcp14">MUST NOT</em> store incomplete or partial-content responses if it does not support the <a href="rfc7233.html#header.range" class="smpl">Range</a> and <a href="rfc7233.html#header.content-range" class="smpl">Content-Range</a> header fields or if it does not understand the range units used in those fields.<a class="self" href="#rfc.section.3.1.p.1">&para;</a></p></div><div id="rfc.section.3.1.p.2"><p>A cache <em class="bcp14">MAY</em> complete a stored incomplete response by making a subsequent range request (<a href="#RFC7233" id="rfc.xref.RFC7233.1"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Range Requests">[RFC7233]</cite></a>) and combining the successful response with the stored entry, as defined in <a href="#combining.responses" title="Combining Partial Content">Section&nbsp;3.3</a>. A cache <em class="bcp14">MUST NOT</em> use an incomplete response to answer requests unless the response has been made complete or the request is partial and specifies a range that is wholly within the incomplete response. A cache <em class="bcp14">MUST NOT</em> send a partial response to a client without explicitly marking it as such using the <a href="rfc7233.html#status.206" class="smpl">206 (Partial Content)</a> status code.<a class="self" href="#rfc.section.3.1.p.2">&para;</a></p></div></div><div id="caching.authenticated.responses"><h2 id="rfc.section.3.2"><a href="#rfc.section.3.2">3.2</a>&nbsp;<a href="#caching.authenticated.responses">Storing Responses to Authenticated Requests</a></h2><div id="rfc.section.3.2.p.1"><p>A shared cache <em class="bcp14">MUST NOT</em> use a cached response to a request with an <a href="rfc7235.html#header.authorization" class="smpl">Authorization</a> header field (<a href="rfc7235.html#header.authorization" title="Authorization">Section 4.2</a> of <a href="#RFC7235" id="rfc.xref.RFC7235.2"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Authentication">[RFC7235]</cite></a>) to satisfy any subsequent request unless a cache directive that allows such responses to be stored is present in the response.<a class="self" href="#rfc.section.3.2.p.1">&para;</a></p></div><div id="rfc.section.3.2.p.2"><p>In this specification, the following <a href="#header.cache-control" class="smpl">Cache-Control</a> response directives (<a href="#cache-response-directive" title="Response Cache-Control Directives">Section&nbsp;5.2.2</a>) have such an effect: must-revalidate, public, and s-maxage.<a class="self" href="#rfc.section.3.2.p.2">&para;</a></p></div><div id="rfc.section.3.2.p.3"><p>Note that cached responses that contain the "must-revalidate" and/or "s-maxage" response directives are not allowed to be served stale (<a href="#serving.stale.responses" title="Serving Stale Responses">Section&nbsp;4.2.4</a>) by shared caches. In particular, a response with either "max-age=0, must-revalidate" or "s-maxage=0" cannot be used to satisfy a subsequent request without revalidating it on the origin server.<a class="self" href="#rfc.section.3.2.p.3">&para;</a></p></div></div><div id="combining.responses"><h2 id="rfc.section.3.3"><a href="#rfc.section.3.3">3.3</a>&nbsp;<a href="#combining.responses">Combining Partial Content</a></h2><div id="rfc.section.3.3.p.1"><p>A response might transfer only a partial representation if the connection closed prematurely or if the request used one or more Range specifiers (<a href="#RFC7233" id="rfc.xref.RFC7233.2"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Range Requests">[RFC7233]</cite></a>). After several such transfers, a cache might have received several ranges of the same representation. A cache <em class="bcp14">MAY</em> combine these ranges into a single stored response, and reuse that response to satisfy later requests, if they all share the same strong validator and the cache complies with the client requirements in <a href="rfc7233.html#combining.byte.ranges" title="Combining Ranges">Section 4.3</a> of <a href="#RFC7233" id="rfc.xref.RFC7233.3"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Range Requests">[RFC7233]</cite></a>.<a class="self" href="#rfc.section.3.3.p.1">&para;</a></p></div><div id="rfc.section.3.3.p.2"><p>When combining the new response with one or more stored responses, a cache <em class="bcp14">MUST</em>: <a class="self" href="#rfc.section.3.3.p.2">&para;</a></p><ul><li>delete any <a href="#header.warning" class="smpl">Warning</a> header fields in the stored response with warn-code 1xx (see <a href="#header.warning" id="rfc.xref.header.warning.1" title="Warning">Section&nbsp;5.5</a>);</li><li>retain any <a href="#header.warning" class="smpl">Warning</a> header fields in the stored response with warn-code 2xx; and,</li><li>use other header fields provided in the new response, aside from <a href="rfc7233.html#header.content-range" class="smpl">Content-Range</a>, to replace all instances of the corresponding header fields in the stored response.</li></ul></div></div></div><div id="constructing.responses.from.caches"><h1 id="rfc.section.4"><a href="#rfc.section.4">4.</a>&nbsp;<a href="#constructing.responses.from.caches">Constructing Responses from Caches</a></h1><div id="rfc.section.4.p.1"><p>When presented with a request, a cache <em class="bcp14">MUST NOT</em> reuse a stored response, unless: <a class="self" href="#rfc.section.4.p.1">&para;</a></p><ul><li>The presented effective request URI (<a href="rfc7230.html#effective.request.uri" title="Effective Request URI">Section 5.5</a> of <a href="#RFC7230" id="rfc.xref.RFC7230.4"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a>) and that of the stored response match, and</li><li>the request method associated with the stored response allows it to be used for the presented request, and</li><li>selecting header fields nominated by the stored response (if any) match those presented (see <a href="#caching.negotiated.responses" title="Calculating Secondary Keys with Vary">Section&nbsp;4.1</a>), and</li><li>the presented request does not contain the no-cache pragma (<a href="#header.pragma" id="rfc.xref.header.pragma.1" title="Pragma">Section&nbsp;5.4</a>), nor the no-cache cache directive (<a href="#cache-request-directive" title="Request Cache-Control Directives">Section&nbsp;5.2.1</a>), unless the stored response is successfully validated (<a href="#validation.model" title="Validation">Section&nbsp;4.3</a>), and</li><li>the stored response does not contain the no-cache cache directive (<a href="#cache-response-directive.no-cache" title="no-cache">Section&nbsp;5.2.2.2</a>), unless it is successfully validated (<a href="#validation.model" title="Validation">Section&nbsp;4.3</a>), and</li><li>the stored response is either: <ul><li>fresh (see <a href="#expiration.model" title="Freshness">Section&nbsp;4.2</a>), or</li><li>allowed to be served stale (see <a href="#serving.stale.responses" title="Serving Stale Responses">Section&nbsp;4.2.4</a>), or</li><li>successfully validated (see <a href="#validation.model" title="Validation">Section&nbsp;4.3</a>).</li></ul> </li></ul></div><div id="rfc.section.4.p.2"><p>Note that any of the requirements listed above can be overridden by a cache-control extension; see <a href="#cache.control.extensions" title="Cache Control Extensions">Section&nbsp;5.2.3</a>.<a class="self" href="#rfc.section.4.p.2">&para;</a></p></div><div id="rfc.section.4.p.3"><p>When a stored response is used to satisfy a request without validation, a cache <em class="bcp14">MUST</em> generate an <a href="#header.age" class="smpl">Age</a> header field (<a href="#header.age" id="rfc.xref.header.age.1" title="Age">Section&nbsp;5.1</a>), replacing any present in the response with a value equal to the stored response's current_age; see <a href="#age.calculations" title="Calculating Age">Section&nbsp;4.2.3</a>.<a class="self" href="#rfc.section.4.p.3">&para;</a></p></div><div id="rfc.section.4.p.4"><p>A cache <em class="bcp14">MUST</em> write through requests with methods that are unsafe (<a href="rfc7231.html#safe.methods" title="Safe Methods">Section 4.2.1</a> of <a href="#RFC7231" id="rfc.xref.RFC7231.3"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[RFC7231]</cite></a>) to the origin server; i.e., a cache is not allowed to generate a reply to such a request before having forwarded the request and having received a corresponding response.<a class="self" href="#rfc.section.4.p.4">&para;</a></p></div><div id="rfc.section.4.p.5"><p>Also, note that unsafe requests might invalidate already-stored responses; see <a href="#invalidation" title="Invalidation">Section&nbsp;4.4</a>.<a class="self" href="#rfc.section.4.p.5">&para;</a></p></div><div id="rfc.section.4.p.6"><p>When more than one suitable response is stored, a cache <em class="bcp14">MUST</em> use the most recent response (as determined by the <a href="rfc7231.html#header.date" class="smpl">Date</a> header field). It can also forward the request with "Cache-Control: max-age=0" or "Cache-Control: no-cache" to disambiguate which response to use.<a class="self" href="#rfc.section.4.p.6">&para;</a></p></div><div id="rfc.section.4.p.7"><p>A cache that does not have a clock available <em class="bcp14">MUST NOT</em> use stored responses without revalidating them upon every use.<a class="self" href="#rfc.section.4.p.7">&para;</a></p></div><div id="caching.negotiated.responses"><h2 id="rfc.section.4.1"><a href="#rfc.section.4.1">4.1</a>&nbsp;<a href="#caching.negotiated.responses">Calculating Secondary Keys with Vary</a></h2><div id="rfc.section.4.1.p.1"><p>When a cache receives a request that can be satisfied by a stored response that has a <a href="rfc7231.html#header.vary" class="smpl">Vary</a> header field (<a href="rfc7231.html#header.vary" title="Vary">Section 7.1.4</a> of <a href="#RFC7231" id="rfc.xref.RFC7231.4"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[RFC7231]</cite></a>), it <em class="bcp14">MUST NOT</em> use that response unless all of the selecting header fields nominated by the Vary header field match in both the original request (i.e., that associated with the stored response), and the presented request.<a class="self" href="#rfc.section.4.1.p.1">&para;</a></p></div><div id="rfc.section.4.1.p.2"><p>The selecting header fields from two requests are defined to match if and only if those in the first request can be transformed to those in the second request by applying any of the following: <a class="self" href="#rfc.section.4.1.p.2">&para;</a></p><ul><li>adding or removing whitespace, where allowed in the header field's syntax</li><li>combining multiple header fields with the same field name (see <a href="rfc7230.html#header.fields" title="Header Fields">Section 3.2</a> of <a href="#RFC7230" id="rfc.xref.RFC7230.5"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a>)</li><li>normalizing both header field values in a way that is known to have identical semantics, according to the header field's specification (e.g., reordering field values when order is not significant; case-normalization, where values are defined to be case-insensitive)</li></ul></div><div id="rfc.section.4.1.p.3"><p>If (after any normalization that might take place) a header field is absent from a request, it can only match another request if it is also absent there.<a class="self" href="#rfc.section.4.1.p.3">&para;</a></p></div><div id="rfc.section.4.1.p.4"><p>A <a href="rfc7231.html#header.vary" class="smpl">Vary</a> header field-value of "*" always fails to match.<a class="self" href="#rfc.section.4.1.p.4">&para;</a></p></div><div id="rfc.section.4.1.p.5"><p>The stored response with matching selecting header fields is known as the selected response.<a class="self" href="#rfc.section.4.1.p.5">&para;</a></p></div><div id="rfc.section.4.1.p.6"><p>If multiple selected responses are available (potentially including responses without a Vary header field), the cache will need to choose one to use. When a selecting header field has a known mechanism for doing so (e.g., qvalues on <a href="rfc7231.html#header.accept" class="smpl">Accept</a> and similar request header fields), that mechanism <em class="bcp14">MAY</em> be used to select preferred responses; of the remainder, the most recent response (as determined by the <a href="rfc7231.html#header.date" class="smpl">Date</a> header field) is used, as per <a href="#constructing.responses.from.caches" title="Constructing Responses from Caches">Section&nbsp;4</a>.<a class="self" href="#rfc.section.4.1.p.6">&para;</a></p></div><div id="rfc.section.4.1.p.7"><p>If no selected response is available, the cache cannot satisfy the presented request. Typically, it is forwarded to the origin server in a (possibly conditional; see <a href="#validation.model" title="Validation">Section&nbsp;4.3</a>) request.<a class="self" href="#rfc.section.4.1.p.7">&para;</a></p></div></div><div id="expiration.model"><h2 id="rfc.section.4.2"><a href="#rfc.section.4.2">4.2</a>&nbsp;<a href="#expiration.model">Freshness</a></h2><div id="rfc.section.4.2.p.1"><p>A <dfn>fresh</dfn> response is one whose age has not yet exceeded its freshness lifetime. Conversely, a <dfn>stale</dfn> response is one where it has.<a class="self" href="#rfc.section.4.2.p.1">&para;</a></p></div><div id="rfc.iref.f.1"></div><div id="rfc.iref.e.1"></div><div id="rfc.iref.h.1"></div><div id="rfc.section.4.2.p.2"><p>A response's <dfn>freshness lifetime</dfn> is the length of time between its generation by the origin server and its expiration time. An <dfn>explicit expiration time</dfn> is the time at which the origin server intends that a stored response can no longer be used by a cache without further validation, whereas a <dfn>heuristic expiration time</dfn> is assigned by a cache when no explicit expiration time is available.<a class="self" href="#rfc.section.4.2.p.2">&para;</a></p></div><div id="rfc.iref.a.1"></div><div id="rfc.section.4.2.p.3"><p>A response's <dfn>age</dfn> is the time that has passed since it was generated by, or successfully validated with, the origin server.<a class="self" href="#rfc.section.4.2.p.3">&para;</a></p></div><div id="rfc.section.4.2.p.4"><p>When a response is "fresh" in the cache, it can be used to satisfy subsequent requests without contacting the origin server, thereby improving efficiency.<a class="self" href="#rfc.section.4.2.p.4">&para;</a></p></div><div id="rfc.section.4.2.p.5"><p>The primary mechanism for determining freshness is for an origin server to provide an explicit expiration time in the future, using either the <a href="#header.expires" class="smpl">Expires</a> header field (<a href="#header.expires" id="rfc.xref.header.expires.2" title="Expires">Section&nbsp;5.3</a>) or the max-age response directive (<a href="#cache-response-directive.max-age" title="max-age">Section&nbsp;5.2.2.8</a>). Generally, origin servers will assign future explicit expiration times to responses in the belief that the representation is not likely to change in a semantically significant way before the expiration time is reached.<a class="self" href="#rfc.section.4.2.p.5">&para;</a></p></div><div id="rfc.section.4.2.p.6"><p>If an origin server wishes to force a cache to validate every request, it can assign an explicit expiration time in the past to indicate that the response is already stale. Compliant caches will normally validate a stale cached response before reusing it for subsequent requests (see <a href="#serving.stale.responses" title="Serving Stale Responses">Section&nbsp;4.2.4</a>).<a class="self" href="#rfc.section.4.2.p.6">&para;</a></p></div><div id="rfc.section.4.2.p.7"><p>Since origin servers do not always provide explicit expiration times, caches are also allowed to use a heuristic to determine an expiration time under certain circumstances (see <a href="#heuristic.freshness" title="Calculating Heuristic Freshness">Section&nbsp;4.2.2</a>).<a class="self" href="#rfc.section.4.2.p.7">&para;</a></p></div><div id="rfc.figure.u.2"><p>The calculation to determine if a response is fresh is:</p><pre class="text">   response_is_fresh = (freshness_lifetime &gt; current_age)
533</pre></div><div id="rfc.section.4.2.p.8"><p>freshness_lifetime is defined in <a href="#calculating.freshness.lifetime" title="Calculating Freshness Lifetime">Section&nbsp;4.2.1</a>; current_age is defined in <a href="#age.calculations" title="Calculating Age">Section&nbsp;4.2.3</a>.<a class="self" href="#rfc.section.4.2.p.8">&para;</a></p></div><div id="rfc.section.4.2.p.9"><p>Clients can send the max-age or min-fresh cache directives in a request to constrain or relax freshness calculations for the corresponding response (<a href="#cache-request-directive" title="Request Cache-Control Directives">Section&nbsp;5.2.1</a>).<a class="self" href="#rfc.section.4.2.p.9">&para;</a></p></div><div id="rfc.section.4.2.p.10"><p>When calculating freshness, to avoid common problems in date parsing:<a class="self" href="#rfc.section.4.2.p.10">&para;</a></p></div><div id="rfc.section.4.2.p.11"><ul><li>Although all date formats are specified to be case-sensitive, a cache recipient <em class="bcp14">SHOULD</em> match day, week, and time-zone names case-insensitively.</li><li>If a cache recipient's internal implementation of time has less resolution than the value of an HTTP-date, the recipient <em class="bcp14">MUST</em> internally represent a parsed <a href="#header.expires" class="smpl">Expires</a> date as the nearest time equal to or earlier than the received value.</li><li>A cache recipient <em class="bcp14">MUST NOT</em> allow local time zones to influence the calculation or comparison of an age or expiration time.</li><li>A cache recipient <em class="bcp14">SHOULD</em> consider a date with a zone abbreviation other than GMT or UTC to be invalid for calculating expiration.</li></ul></div><div id="rfc.section.4.2.p.12"><p>Note that freshness applies only to cache operation; it cannot be used to force a user agent to refresh its display or reload a resource. See <a href="#history.lists" title="History Lists">Section&nbsp;6</a> for an explanation of the difference between caches and history mechanisms.<a class="self" href="#rfc.section.4.2.p.12">&para;</a></p></div><div id="calculating.freshness.lifetime"><h3 id="rfc.section.4.2.1"><a href="#rfc.section.4.2.1">4.2.1</a>&nbsp;<a href="#calculating.freshness.lifetime">Calculating Freshness Lifetime</a></h3><div id="rfc.section.4.2.1.p.1"><p>A cache can calculate the freshness lifetime (denoted as freshness_lifetime) of a response by using the first match of the following: <a class="self" href="#rfc.section.4.2.1.p.1">&para;</a></p><ul><li>If the cache is shared and the s-maxage response directive (<a href="#cache-response-directive.s-maxage" title="s-maxage">Section&nbsp;5.2.2.9</a>) is present, use its value, or</li><li>If the max-age response directive (<a href="#cache-response-directive.max-age" title="max-age">Section&nbsp;5.2.2.8</a>) is present, use its value, or</li><li>If the <a href="#header.expires" class="smpl">Expires</a> response header field (<a href="#header.expires" id="rfc.xref.header.expires.3" title="Expires">Section&nbsp;5.3</a>) is present, use its value minus the value of the <a href="rfc7231.html#header.date" class="smpl">Date</a> response header field, or</li><li>Otherwise, no explicit expiration time is present in the response. A heuristic freshness lifetime might be applicable; see <a href="#heuristic.freshness" title="Calculating Heuristic Freshness">Section&nbsp;4.2.2</a>.</li></ul></div><div id="rfc.section.4.2.1.p.2"><p>Note that this calculation is not vulnerable to clock skew, since all of the information comes from the origin server.<a class="self" href="#rfc.section.4.2.1.p.2">&para;</a></p></div><div id="rfc.section.4.2.1.p.3"><p>When there is more than one value present for a given directive (e.g., two <a href="#header.expires" class="smpl">Expires</a> header fields, multiple Cache-Control: max-age directives), the directive's value is considered invalid. Caches are encouraged to consider responses that have invalid freshness information to be stale.<a class="self" href="#rfc.section.4.2.1.p.3">&para;</a></p></div></div><div id="heuristic.freshness"><h3 id="rfc.section.4.2.2"><a href="#rfc.section.4.2.2">4.2.2</a>&nbsp;<a href="#heuristic.freshness">Calculating Heuristic Freshness</a></h3><div id="rfc.section.4.2.2.p.1"><p>Since origin servers do not always provide explicit expiration times, a cache <em class="bcp14">MAY</em> assign a heuristic expiration time when an explicit time is not specified, employing algorithms that use other header field values (such as the <a href="rfc7232.html#header.last-modified" class="smpl">Last-Modified</a> time) to estimate a plausible expiration time. This specification does not provide specific algorithms, but does impose worst-case constraints on their results.<a class="self" href="#rfc.section.4.2.2.p.1">&para;</a></p></div><div id="rfc.section.4.2.2.p.2"><p>A cache <em class="bcp14">MUST NOT</em> use heuristics to determine freshness when an explicit expiration time is present in the stored response. Because of the requirements in <a href="#response.cacheability" title="Storing Responses in Caches">Section&nbsp;3</a>, this means that, effectively, heuristics can only be used on responses without explicit freshness whose status codes are defined as cacheable by default (see <a href="rfc7231.html#overview.of.status.codes" title="Overview of Status Codes">Section 6.1</a> of <a href="#RFC7231" id="rfc.xref.RFC7231.5"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[RFC7231]</cite></a>), and those responses without explicit freshness that have been marked as explicitly cacheable (e.g., with a "public" response directive).<a class="self" href="#rfc.section.4.2.2.p.2">&para;</a></p></div><div id="rfc.section.4.2.2.p.3"><p>If the response has a <a href="rfc7232.html#header.last-modified" class="smpl">Last-Modified</a> header field (<a href="rfc7232.html#header.last-modified" title="Last-Modified">Section 2.2</a> of <a href="#RFC7232" id="rfc.xref.RFC7232.1"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[RFC7232]</cite></a>), caches are encouraged to use a heuristic expiration value that is no more than some fraction of the interval since that time. A typical setting of this fraction might be 10%.<a class="self" href="#rfc.section.4.2.2.p.3">&para;</a></p></div><div id="rfc.section.4.2.2.p.4"><p>When a heuristic is used to calculate freshness lifetime, a cache <em class="bcp14">SHOULD</em> generate a <a href="#header.warning" class="smpl">Warning</a> header field with a 113 warn-code (see <a href="#warn.113" id="rfc.xref.warn.113.1" title="Warning: 113 - &#34;Heuristic Expiration&#34;">Section&nbsp;5.5.4</a>) in the response if its current_age is more than 24 hours and such a warning is not already present.<a class="self" href="#rfc.section.4.2.2.p.4">&para;</a></p></div><div class="note"><div id="rfc.section.4.2.2.p.5"><p><b>Note:</b> <a href="https://tools.ietf.org/html/rfc2616#section-13.9">Section 13.9</a> of <a href="#RFC2616" id="rfc.xref.RFC2616.1"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> prohibited caches from calculating heuristic freshness for URIs with query components (i.e., those containing '?'). In practice, this has not been widely implemented. Therefore, origin servers are encouraged to send explicit directives (e.g., Cache-Control: no-cache) if they wish to preclude caching.<a class="self" href="#rfc.section.4.2.2.p.5">&para;</a></p></div></div></div><div id="age.calculations"><h3 id="rfc.section.4.2.3"><a href="#rfc.section.4.2.3">4.2.3</a>&nbsp;<a href="#age.calculations">Calculating Age</a></h3><div id="rfc.section.4.2.3.p.1"><p>The <a href="#header.age" class="smpl">Age</a> header field is used to convey an estimated age of the response message when obtained from a cache. The Age field value is the cache's estimate of the number of seconds since the response was generated or validated by the origin server. In essence, the Age value is the sum of the time that the response has been resident in each of the caches along the path from the origin server, plus the amount of time it has been in transit along network paths.<a class="self" href="#rfc.section.4.2.3.p.1">&para;</a></p></div><div id="rfc.section.4.2.3.p.2"><p>The following data is used for the age calculation:<a class="self" href="#rfc.section.4.2.3.p.2">&para;</a></p></div><div id="rfc.section.4.2.3.p.3"><p><dfn>age_value</dfn> <a class="self" href="#rfc.section.4.2.3.p.3">&para;</a></p><ul class="empty"><li>The term "age_value" denotes the value of the <a href="#header.age" class="smpl">Age</a> header field (<a href="#header.age" id="rfc.xref.header.age.2" title="Age">Section&nbsp;5.1</a>), in a form appropriate for arithmetic operation; or 0, if not available.</li></ul></div><div id="rfc.section.4.2.3.p.4"><p><dfn>date_value</dfn> <a class="self" href="#rfc.section.4.2.3.p.4">&para;</a></p><ul class="empty"><li>The term "date_value" denotes the value of the Date header field, in a form appropriate for arithmetic operations. See <a href="rfc7231.html#header.date" title="Date">Section 7.1.1.2</a> of <a href="#RFC7231" id="rfc.xref.RFC7231.6"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[RFC7231]</cite></a> for the definition of the Date header field, and for requirements regarding responses without it.</li></ul></div><div id="rfc.section.4.2.3.p.5"><p><dfn>now</dfn> <a class="self" href="#rfc.section.4.2.3.p.5">&para;</a></p><ul class="empty"><li>The term "now" means "the current value of the clock at the host performing the calculation". A host ought to use NTP (<a href="#RFC5905" id="rfc.xref.RFC5905.1"><cite title="Network Time Protocol Version 4: Protocol and Algorithms Specification">[RFC5905]</cite></a>) or some similar protocol to synchronize its clocks to Coordinated Universal Time.</li></ul></div><div id="rfc.section.4.2.3.p.6"><p><dfn>request_time</dfn> <a class="self" href="#rfc.section.4.2.3.p.6">&para;</a></p><ul class="empty"><li>The current value of the clock at the host at the time the request resulting in the stored response was made.</li></ul></div><div id="rfc.section.4.2.3.p.7"><p><dfn>response_time</dfn> <a class="self" href="#rfc.section.4.2.3.p.7">&para;</a></p><ul class="empty"><li>The current value of the clock at the host at the time the response was received.</li></ul></div><div id="rfc.section.4.2.3.p.8"><p>A response's age can be calculated in two entirely independent ways: <a class="self" href="#rfc.section.4.2.3.p.8">&para;</a></p><ol><li>the "apparent_age": response_time minus date_value, if the local clock is reasonably well synchronized to the origin server's clock. If the result is negative, the result is replaced by zero.</li><li>the "corrected_age_value", if all of the caches along the response path implement HTTP/1.1. A cache <em class="bcp14">MUST</em> interpret this value relative to the time the request was initiated, not the time that the response was received.</li></ol></div><div id="rfc.figure.u.3"><pre class="text">  apparent_age = max(0, response_time - date_value);
534
535  response_delay = response_time - request_time;
536  corrected_age_value = age_value + response_delay; 
537</pre></div><div id="rfc.figure.u.4"><p>These are combined as</p><pre class="text">  corrected_initial_age = max(apparent_age, corrected_age_value);
538</pre></div><div id="rfc.section.4.2.3.p.9"><p>unless the cache is confident in the value of the <a href="#header.age" class="smpl">Age</a> header field (e.g., because there are no HTTP/1.0 hops in the <a href="rfc7230.html#header.via" class="smpl">Via</a> header field), in which case the corrected_age_value <em class="bcp14">MAY</em> be used as the corrected_initial_age.<a class="self" href="#rfc.section.4.2.3.p.9">&para;</a></p></div><div id="rfc.section.4.2.3.p.10"><p>The current_age of a stored response can then be calculated by adding the amount of time (in seconds) since the stored response was last validated by the origin server to the corrected_initial_age.<a class="self" href="#rfc.section.4.2.3.p.10">&para;</a></p></div><div id="rfc.figure.u.5"><pre class="text">  resident_time = now - response_time;
539  current_age = corrected_initial_age + resident_time;
540</pre></div></div><div id="serving.stale.responses"><h3 id="rfc.section.4.2.4"><a href="#rfc.section.4.2.4">4.2.4</a>&nbsp;<a href="#serving.stale.responses">Serving Stale Responses</a></h3><div id="rfc.section.4.2.4.p.1"><p>A "stale" response is one that either has explicit expiry information or is allowed to have heuristic expiry calculated, but is not fresh according to the calculations in <a href="#expiration.model" title="Freshness">Section&nbsp;4.2</a>.<a class="self" href="#rfc.section.4.2.4.p.1">&para;</a></p></div><div id="rfc.section.4.2.4.p.2"><p>A cache <em class="bcp14">MUST NOT</em> generate a stale response if it is prohibited by an explicit in-protocol directive (e.g., by a "no-store" or "no-cache" cache directive, a "must-revalidate" cache-response-directive, or an applicable "s-maxage" or "proxy-revalidate" cache-response-directive; see <a href="#cache-response-directive" title="Response Cache-Control Directives">Section&nbsp;5.2.2</a>).<a class="self" href="#rfc.section.4.2.4.p.2">&para;</a></p></div><div id="rfc.section.4.2.4.p.3"><p>A cache <em class="bcp14">MUST NOT</em> send stale responses unless it is disconnected (i.e., it cannot contact the origin server or otherwise find a forward path) or doing so is explicitly allowed (e.g., by the max-stale request directive; see <a href="#cache-request-directive" title="Request Cache-Control Directives">Section&nbsp;5.2.1</a>).<a class="self" href="#rfc.section.4.2.4.p.3">&para;</a></p></div><div id="rfc.section.4.2.4.p.4"><p>A cache <em class="bcp14">SHOULD</em> generate a <a href="#header.warning" class="smpl">Warning</a> header field with the 110 warn-code (see <a href="#warn.110" id="rfc.xref.warn.110.1" title="Warning: 110 - &#34;Response is Stale&#34;">Section&nbsp;5.5.1</a>) in stale responses. Likewise, a cache <em class="bcp14">SHOULD</em> generate a 112 warn-code (see <a href="#warn.112" id="rfc.xref.warn.112.1" title="Warning: 112 - &#34;Disconnected Operation&#34;">Section&nbsp;5.5.3</a>) in stale responses if the cache is disconnected.<a class="self" href="#rfc.section.4.2.4.p.4">&para;</a></p></div><div id="rfc.section.4.2.4.p.5"><p>A cache <em class="bcp14">SHOULD NOT</em> generate a new <a href="#header.warning" class="smpl">Warning</a> header field when forwarding a response that does not have an <a href="#header.age" class="smpl">Age</a> header field, even if the response is already stale. A cache need not validate a response that merely became stale in transit.<a class="self" href="#rfc.section.4.2.4.p.5">&para;</a></p></div></div></div><div id="validation.model"><h2 id="rfc.section.4.3"><a href="#rfc.section.4.3">4.3</a>&nbsp;<a href="#validation.model">Validation</a></h2><div id="rfc.section.4.3.p.1"><p>When a cache has one or more stored responses for a requested URI, but cannot serve any of them (e.g., because they are not fresh, or one cannot be selected; see <a href="#caching.negotiated.responses" title="Calculating Secondary Keys with Vary">Section&nbsp;4.1</a>), it can use the conditional request mechanism <a href="#RFC7232" id="rfc.xref.RFC7232.2"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[RFC7232]</cite></a> in the forwarded request to give the next inbound server an opportunity to select a valid stored response to use, updating the stored metadata in the process, or to replace the stored response(s) with a new response. This process is known as "validating" or "revalidating" the stored response.<a class="self" href="#rfc.section.4.3.p.1">&para;</a></p></div><div id="validation.sent"><h3 id="rfc.section.4.3.1"><a href="#rfc.section.4.3.1">4.3.1</a>&nbsp;<a href="#validation.sent">Sending a Validation Request</a></h3><div id="rfc.section.4.3.1.p.1"><p>When sending a conditional request for cache validation, a cache sends one or more precondition header fields containing <dfn>validator</dfn> metadata from its stored response(s), which is then compared by recipients to determine whether a stored response is equivalent to a current representation of the resource.<a class="self" href="#rfc.section.4.3.1.p.1">&para;</a></p></div><div id="rfc.section.4.3.1.p.2"><p>One such validator is the timestamp given in a <a href="rfc7232.html#header.last-modified" class="smpl">Last-Modified</a> header field (<a href="rfc7232.html#header.last-modified" title="Last-Modified">Section 2.2</a> of <a href="#RFC7232" id="rfc.xref.RFC7232.3"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[RFC7232]</cite></a>), which can be used in an <a href="rfc7232.html#header.if-modified-since" class="smpl">If-Modified-Since</a> header field for response validation, or in an <a href="rfc7232.html#header.if-unmodified-since" class="smpl">If-Unmodified-Since</a> or <a href="rfc7233.html#header.if-range" class="smpl">If-Range</a> header field for representation selection (i.e., the client is referring specifically to a previously obtained representation with that timestamp).<a class="self" href="#rfc.section.4.3.1.p.2">&para;</a></p></div><div id="rfc.section.4.3.1.p.3"><p>Another validator is the entity-tag given in an <a href="rfc7232.html#header.etag" class="smpl">ETag</a> header field (<a href="rfc7232.html#header.etag" title="ETag">Section 2.3</a> of <a href="#RFC7232" id="rfc.xref.RFC7232.4"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[RFC7232]</cite></a>). One or more entity-tags, indicating one or more stored responses, can be used in an <a href="rfc7232.html#header.if-none-match" class="smpl">If-None-Match</a> header field for response validation, or in an <a href="rfc7232.html#header.if-match" class="smpl">If-Match</a> or <a href="rfc7233.html#header.if-range" class="smpl">If-Range</a> header field for representation selection (i.e., the client is referring specifically to one or more previously obtained representations with the listed entity-tags).<a class="self" href="#rfc.section.4.3.1.p.3">&para;</a></p></div></div><div id="validation.received"><h3 id="rfc.section.4.3.2"><a href="#rfc.section.4.3.2">4.3.2</a>&nbsp;<a href="#validation.received">Handling a Received Validation Request</a></h3><div id="rfc.section.4.3.2.p.1"><p>Each client in the request chain may have its own cache, so it is common for a cache at an intermediary to receive conditional requests from other (outbound) caches. Likewise, some user agents make use of conditional requests to limit data transfers to recently modified representations or to complete the transfer of a partially retrieved representation.<a class="self" href="#rfc.section.4.3.2.p.1">&para;</a></p></div><div id="rfc.section.4.3.2.p.2"><p>If a cache receives a request that can be satisfied by reusing one of its stored <a href="rfc7231.html#status.200" class="smpl">200 (OK)</a> or <a href="rfc7233.html#status.206" class="smpl">206 (Partial Content)</a> responses, the cache <em class="bcp14">SHOULD</em> evaluate any applicable conditional header field preconditions received in that request with respect to the corresponding validators contained within the selected response. A cache <em class="bcp14">MUST NOT</em> evaluate conditional header fields that are only applicable to an origin server, found in a request with semantics that cannot be satisfied with a cached response, or applied to a target resource for which it has no stored responses; such preconditions are likely intended for some other (inbound) server.<a class="self" href="#rfc.section.4.3.2.p.2">&para;</a></p></div><div id="rfc.section.4.3.2.p.3"><p>The proper evaluation of conditional requests by a cache depends on the received precondition header fields and their precedence, as defined in <a href="rfc7232.html#precedence" title="Precedence">Section 6</a> of <a href="#RFC7232" id="rfc.xref.RFC7232.5"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[RFC7232]</cite></a>. The <a href="rfc7232.html#header.if-match" class="smpl">If-Match</a> and <a href="rfc7232.html#header.if-unmodified-since" class="smpl">If-Unmodified-Since</a> conditional header fields are not applicable to a cache.<a class="self" href="#rfc.section.4.3.2.p.3">&para;</a></p></div><div id="rfc.section.4.3.2.p.4"><p>A request containing an <a href="rfc7232.html#header.if-none-match" class="smpl">If-None-Match</a> header field (<a href="rfc7232.html#header.if-none-match" title="If-None-Match">Section 3.2</a> of <a href="#RFC7232" id="rfc.xref.RFC7232.6"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[RFC7232]</cite></a>) indicates that the client wants to validate one or more of its own stored responses in comparison to whichever stored response is selected by the cache. If the field-value is "*", or if the field-value is a list of entity-tags and at least one of them matches the entity-tag of the selected stored response, a cache recipient <em class="bcp14">SHOULD</em> generate a <a href="rfc7232.html#status.304" class="smpl">304 (Not Modified)</a> response (using the metadata of the selected stored response) instead of sending that stored response.<a class="self" href="#rfc.section.4.3.2.p.4">&para;</a></p></div><div id="rfc.section.4.3.2.p.5"><p>When a cache decides to revalidate its own stored responses for a request that contains an <a href="rfc7232.html#header.if-none-match" class="smpl">If-None-Match</a> list of entity-tags, the cache <em class="bcp14">MAY</em> combine the received list with a list of entity-tags from its own stored set of responses (fresh or stale) and send the union of the two lists as a replacement <a href="rfc7232.html#header.if-none-match" class="smpl">If-None-Match</a> header field value in the forwarded request. If a stored response contains only partial content, the cache <em class="bcp14">MUST NOT</em> include its entity-tag in the union unless the request is for a range that would be fully satisfied by that partial stored response. If the response to the forwarded request is <a href="rfc7232.html#status.304" class="smpl">304 (Not Modified)</a> and has an ETag header field value with an entity-tag that is not in the client's list, the cache <em class="bcp14">MUST</em> generate a <a href="rfc7231.html#status.200" class="smpl">200 (OK)</a> response for the client by reusing its corresponding stored response, as updated by the 304 response metadata (<a href="#freshening.responses" title="Freshening Stored Responses upon Validation">Section&nbsp;4.3.4</a>).<a class="self" href="#rfc.section.4.3.2.p.5">&para;</a></p></div><div id="rfc.section.4.3.2.p.6"><p>If an <a href="rfc7232.html#header.if-none-match" class="smpl">If-None-Match</a> header field is not present, a request containing an <a href="rfc7232.html#header.if-modified-since" class="smpl">If-Modified-Since</a> header field (<a href="rfc7232.html#header.if-modified-since" title="If-Modified-Since">Section 3.3</a> of <a href="#RFC7232" id="rfc.xref.RFC7232.7"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[RFC7232]</cite></a>) indicates that the client wants to validate one or more of its own stored responses by modification date. A cache recipient <em class="bcp14">SHOULD</em> generate a <a href="rfc7232.html#status.304" class="smpl">304 (Not Modified)</a> response (using the metadata of the selected stored response) if one of the following cases is true: 1) the selected stored response has a <a href="rfc7232.html#header.last-modified" class="smpl">Last-Modified</a> field-value that is earlier than or equal to the conditional timestamp; 2) no <a href="rfc7232.html#header.last-modified" class="smpl">Last-Modified</a> field is present in the selected stored response, but it has a <a href="rfc7231.html#header.date" class="smpl">Date</a> field-value that is earlier than or equal to the conditional timestamp; or, 3) neither <a href="rfc7232.html#header.last-modified" class="smpl">Last-Modified</a> nor <a href="rfc7231.html#header.date" class="smpl">Date</a> is present in the selected stored response, but the cache recorded it as having been received at a time earlier than or equal to the conditional timestamp.<a class="self" href="#rfc.section.4.3.2.p.6">&para;</a></p></div><div id="rfc.section.4.3.2.p.7"><p>A cache that implements partial responses to range requests, as defined in <a href="#RFC7233" id="rfc.xref.RFC7233.4"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Range Requests">[RFC7233]</cite></a>, also needs to evaluate a received <a href="rfc7233.html#header.if-range" class="smpl">If-Range</a> header field (<a href="rfc7233.html#header.if-range" title="If-Range">Section 3.2</a> of <a href="#RFC7233" id="rfc.xref.RFC7233.5"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Range Requests">[RFC7233]</cite></a>) with respect to its selected stored response.<a class="self" href="#rfc.section.4.3.2.p.7">&para;</a></p></div></div><div id="validation.response"><h3 id="rfc.section.4.3.3"><a href="#rfc.section.4.3.3">4.3.3</a>&nbsp;<a href="#validation.response">Handling a Validation Response</a></h3><div id="rfc.section.4.3.3.p.1"><p>Cache handling of a response to a conditional request is dependent upon its status code:<a class="self" href="#rfc.section.4.3.3.p.1">&para;</a></p></div><div id="rfc.section.4.3.3.p.2"><ul><li>A <a href="rfc7232.html#status.304" class="smpl">304 (Not Modified)</a> response status code indicates that the stored response can be updated and reused; see <a href="#freshening.responses" title="Freshening Stored Responses upon Validation">Section&nbsp;4.3.4</a>.</li><li>A full response (i.e., one with a payload body) indicates that none of the stored responses nominated in the conditional request is suitable. Instead, the cache <em class="bcp14">MUST</em> use the full response to satisfy the request and <em class="bcp14">MAY</em> replace the stored response(s).</li><li>However, if a cache receives a <a href="rfc7231.html#status.5xx" class="smpl">5xx (Server Error)</a> response while attempting to validate a response, it can either forward this response to the requesting client, or act as if the server failed to respond. In the latter case, the cache <em class="bcp14">MAY</em> send a previously stored response (see <a href="#serving.stale.responses" title="Serving Stale Responses">Section&nbsp;4.2.4</a>).</li></ul></div></div><div id="freshening.responses"><h3 id="rfc.section.4.3.4"><a href="#rfc.section.4.3.4">4.3.4</a>&nbsp;<a href="#freshening.responses">Freshening Stored Responses upon Validation</a></h3><div id="rfc.section.4.3.4.p.1"><p>When a cache receives a <a href="rfc7232.html#status.304" class="smpl">304 (Not Modified)</a> response and already has one or more stored <a href="rfc7231.html#status.200" class="smpl">200 (OK)</a> responses for the same cache key, the cache needs to identify which of the stored responses are updated by this new response and then update the stored response(s) with the new information provided in the <a href="rfc7232.html#status.304" class="smpl">304</a> response.<a class="self" href="#rfc.section.4.3.4.p.1">&para;</a></p></div><div id="rfc.iref.s.2"></div><div id="rfc.section.4.3.4.p.2"><p>The stored response to update is identified by using the first match (if any) of the following: <a class="self" href="#rfc.section.4.3.4.p.2">&para;</a></p><ul><li>If the new response contains a <dfn>strong validator</dfn> (see <a href="rfc7232.html#weak.and.strong.validators" title="Weak versus Strong">Section 2.1</a> of <a href="#RFC7232" id="rfc.xref.RFC7232.8"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[RFC7232]</cite></a>), then that strong validator identifies the selected representation for update. All of the stored responses with the same strong validator are selected. If none of the stored responses contain the same strong validator, then the cache <em class="bcp14">MUST NOT</em> use the new response to update any stored responses.</li><li>If the new response contains a weak validator and that validator corresponds to one of the cache's stored responses, then the most recent of those matching stored responses is selected for update.</li><li>If the new response does not include any form of validator (such as in the case where a client generates an If-Modified-Since request from a source other than the Last-Modified response header field), and there is only one stored response, and that stored response also lacks a validator, then that stored response is selected for update.</li></ul></div><div id="rfc.section.4.3.4.p.3"><p>If a stored response is selected for update, the cache <em class="bcp14">MUST</em>: <a class="self" href="#rfc.section.4.3.4.p.3">&para;</a></p><ul><li>delete any <a href="#header.warning" class="smpl">Warning</a> header fields in the stored response with warn-code 1xx (see <a href="#header.warning" id="rfc.xref.header.warning.2" title="Warning">Section&nbsp;5.5</a>);</li><li>retain any <a href="#header.warning" class="smpl">Warning</a> header fields in the stored response with warn-code 2xx; and,</li><li>use other header fields provided in the <a href="rfc7232.html#status.304" class="smpl">304 (Not Modified)</a> response to replace all instances of the corresponding header fields in the stored response.</li></ul></div></div><div id="head.effects"><h3 id="rfc.section.4.3.5"><a href="#rfc.section.4.3.5">4.3.5</a>&nbsp;<a href="#head.effects">Freshening Responses via HEAD</a></h3><div id="rfc.section.4.3.5.p.1"><p>A response to the HEAD method is identical to what an equivalent request made with a GET would have been, except it lacks a body. This property of HEAD responses can be used to invalidate or update a cached GET response if the more efficient conditional GET request mechanism is not available (due to no validators being present in the stored response) or if transmission of the representation body is not desired even if it has changed.<a class="self" href="#rfc.section.4.3.5.p.1">&para;</a></p></div><div id="rfc.section.4.3.5.p.2"><p>When a cache makes an inbound HEAD request for a given request target and receives a <a href="rfc7231.html#status.200" class="smpl">200 (OK)</a> response, the cache <em class="bcp14">SHOULD</em> update or invalidate each of its stored GET responses that could have been selected for that request (see <a href="#caching.negotiated.responses" title="Calculating Secondary Keys with Vary">Section&nbsp;4.1</a>).<a class="self" href="#rfc.section.4.3.5.p.2">&para;</a></p></div><div id="rfc.section.4.3.5.p.3"><p>For each of the stored responses that could have been selected, if the stored response and HEAD response have matching values for any received validator fields (<a href="rfc7232.html#header.etag" class="smpl">ETag</a> and <a href="rfc7232.html#header.last-modified" class="smpl">Last-Modified</a>) and, if the HEAD response has a <a href="rfc7230.html#header.content-length" class="smpl">Content-Length</a> header field, the value of <a href="rfc7230.html#header.content-length" class="smpl">Content-Length</a> matches that of the stored response, the cache <em class="bcp14">SHOULD</em> update the stored response as described below; otherwise, the cache <em class="bcp14">SHOULD</em> consider the stored response to be stale.<a class="self" href="#rfc.section.4.3.5.p.3">&para;</a></p></div><div id="rfc.section.4.3.5.p.4"><p>If a cache updates a stored response with the metadata provided in a HEAD response, the cache <em class="bcp14">MUST</em>: <a class="self" href="#rfc.section.4.3.5.p.4">&para;</a></p><ul><li>delete any <a href="#header.warning" class="smpl">Warning</a> header fields in the stored response with warn-code 1xx (see <a href="#header.warning" id="rfc.xref.header.warning.3" title="Warning">Section&nbsp;5.5</a>);</li><li>retain any <a href="#header.warning" class="smpl">Warning</a> header fields in the stored response with warn-code 2xx; and,</li><li>use other header fields provided in the HEAD response to replace all instances of the corresponding header fields in the stored response and append new header fields to the stored response's header section unless otherwise restricted by the <a href="#header.cache-control" class="smpl">Cache-Control</a> header field.</li></ul></div></div></div><div id="invalidation"><h2 id="rfc.section.4.4"><a href="#rfc.section.4.4">4.4</a>&nbsp;<a href="#invalidation">Invalidation</a></h2><div id="rfc.section.4.4.p.1"><p>Because unsafe request methods (<a href="rfc7231.html#safe.methods" title="Safe Methods">Section 4.2.1</a> of <a href="#RFC7231" id="rfc.xref.RFC7231.7"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[RFC7231]</cite></a>) such as PUT, POST or DELETE have the potential for changing state on the origin server, intervening caches can use them to keep their contents up to date.<a class="self" href="#rfc.section.4.4.p.1">&para;</a></p></div><div id="rfc.section.4.4.p.2"><p>A cache <em class="bcp14">MUST</em> invalidate the effective Request URI (<a href="rfc7230.html#effective.request.uri" title="Effective Request URI">Section 5.5</a> of <a href="#RFC7230" id="rfc.xref.RFC7230.6"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a>) as well as the URI(s) in the <a href="rfc7231.html#header.location" class="smpl">Location</a> and <a href="rfc7231.html#header.content-location" class="smpl">Content-Location</a> response header fields (if present) when a non-error status code is received in response to an unsafe request method.<a class="self" href="#rfc.section.4.4.p.2">&para;</a></p></div><div id="rfc.section.4.4.p.3"><p>However, a cache <em class="bcp14">MUST NOT</em> invalidate a URI from a <a href="rfc7231.html#header.location" class="smpl">Location</a> or <a href="rfc7231.html#header.content-location" class="smpl">Content-Location</a> response header field if the host part of that URI differs from the host part in the effective request URI (<a href="rfc7230.html#effective.request.uri" title="Effective Request URI">Section 5.5</a> of <a href="#RFC7230" id="rfc.xref.RFC7230.7"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a>). This helps prevent denial-of-service attacks.<a class="self" href="#rfc.section.4.4.p.3">&para;</a></p></div><div id="rfc.section.4.4.p.4"><p>A cache <em class="bcp14">MUST</em> invalidate the effective request URI (<a href="rfc7230.html#effective.request.uri" title="Effective Request URI">Section 5.5</a> of <a href="#RFC7230" id="rfc.xref.RFC7230.8"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a>) when it receives a non-error response to a request with a method whose safety is unknown.<a class="self" href="#rfc.section.4.4.p.4">&para;</a></p></div><div id="rfc.section.4.4.p.5"><p>Here, a "non-error response" is one with a <a href="rfc7231.html#status.2xx" class="smpl">2xx (Successful)</a> or <a href="rfc7231.html#status.3xx" class="smpl">3xx (Redirection)</a> status code. "Invalidate" means that the cache will either remove all stored responses related to the effective request URI or will mark these as "invalid" and in need of a mandatory validation before they can be sent in response to a subsequent request.<a class="self" href="#rfc.section.4.4.p.5">&para;</a></p></div><div id="rfc.section.4.4.p.6"><p>Note that this does not guarantee that all appropriate responses are invalidated. For example, a state-changing request might invalidate responses in the caches it travels through, but relevant responses still might be stored in other caches that it has not.<a class="self" href="#rfc.section.4.4.p.6">&para;</a></p></div></div></div><div id="header.field.definitions"><h1 id="rfc.section.5"><a href="#rfc.section.5">5.</a>&nbsp;<a href="#header.field.definitions">Header Field Definitions</a></h1><div id="rfc.section.5.p.1"><p>This section defines the syntax and semantics of HTTP/1.1 header fields related to caching.<a class="self" href="#rfc.section.5.p.1">&para;</a></p></div><div id="header.age"><h2 id="rfc.section.5.1"><a href="#rfc.section.5.1">5.1</a>&nbsp;<a href="#header.age">Age</a></h2><div id="rfc.section.5.1.p.1"><p>The "Age" header field conveys the sender's estimate of the amount of time since the response was generated or successfully validated at the origin server. Age values are calculated as specified in <a href="#age.calculations" title="Calculating Age">Section&nbsp;4.2.3</a>.<a class="self" href="#rfc.section.5.1.p.1">&para;</a></p></div><div id="rfc.figure.u.6"><pre class="inline"><span id="rfc.iref.g.2"></span>  <a href="#header.age" class="smpl">Age</a> = <a href="#delta-seconds" class="smpl">delta-seconds</a>
541</pre></div><div id="rfc.section.5.1.p.2"><p>The Age field-value is a non-negative integer, representing time in seconds (see <a href="#delta-seconds" title="Delta Seconds">Section&nbsp;1.2.1</a>).<a class="self" href="#rfc.section.5.1.p.2">&para;</a></p></div><div id="rfc.section.5.1.p.3"><p>The presence of an Age header field implies that the response was not generated or validated by the origin server for this request. However, lack of an Age header field does not imply the origin was contacted, since the response might have been received from an HTTP/1.0 cache that does not implement Age.<a class="self" href="#rfc.section.5.1.p.3">&para;</a></p></div></div><div id="header.cache-control"><h2 id="rfc.section.5.2"><a href="#rfc.section.5.2">5.2</a>&nbsp;<a href="#header.cache-control">Cache-Control</a></h2><div id="rfc.section.5.2.p.1"><p>The "Cache-Control" header field is used to specify directives for caches along the request/response chain. Such cache directives are unidirectional in that the presence of a directive in a request does not imply that the same directive is to be given in the response.<a class="self" href="#rfc.section.5.2.p.1">&para;</a></p></div><div id="rfc.section.5.2.p.2"><p>A cache <em class="bcp14">MUST</em> obey the requirements of the Cache-Control directives defined in this section. See <a href="#cache.control.extensions" title="Cache Control Extensions">Section&nbsp;5.2.3</a> for information about how Cache-Control directives defined elsewhere are handled.<a class="self" href="#rfc.section.5.2.p.2">&para;</a></p></div><div class="note"><div id="rfc.section.5.2.p.3"><p><b>Note:</b> Some HTTP/1.0 caches might not implement Cache-Control.<a class="self" href="#rfc.section.5.2.p.3">&para;</a></p></div></div><div id="rfc.section.5.2.p.4"><p>A proxy, whether or not it implements a cache, <em class="bcp14">MUST</em> pass cache directives through in forwarded messages, regardless of their significance to that application, since the directives might be applicable to all recipients along the request/response chain. It is not possible to target a directive to a specific cache.<a class="self" href="#rfc.section.5.2.p.4">&para;</a></p></div><div id="rfc.section.5.2.p.5"><p>Cache directives are identified by a token, to be compared case-insensitively, and have an optional argument, that can use both token and quoted-string syntax. For the directives defined below that define arguments, recipients ought to accept both forms, even if one is documented to be preferred. For any directive not defined by this specification, a recipient <em class="bcp14">MUST</em> accept both forms.<a class="self" href="#rfc.section.5.2.p.5">&para;</a></p></div><div id="rfc.figure.u.7"><pre class="inline"><span id="rfc.iref.g.3"></span><span id="rfc.iref.g.4"></span>  <a href="#header.cache-control" class="smpl">Cache-Control</a>   = 1#<a href="#header.cache-control" class="smpl">cache-directive</a>
542
543  <a href="#header.cache-control" class="smpl">cache-directive</a> = <a href="#imported.abnf" class="smpl">token</a> [ "=" ( <a href="#imported.abnf" class="smpl">token</a> / <a href="#imported.abnf" class="smpl">quoted-string</a> ) ]
544</pre></div><div id="rfc.section.5.2.p.6"><p>For the cache directives defined below, no argument is defined (nor allowed) unless stated otherwise.<a class="self" href="#rfc.section.5.2.p.6">&para;</a></p></div><div id="cache-request-directive"><h3 id="rfc.section.5.2.1"><a href="#rfc.section.5.2.1">5.2.1</a>&nbsp;<a href="#cache-request-directive">Request Cache-Control Directives</a></h3><div id="cache-request-directive.max-age"><h4 id="rfc.section.5.2.1.1"><a href="#rfc.section.5.2.1.1">5.2.1.1</a>&nbsp;<a href="#cache-request-directive.max-age">max-age</a></h4><div id="rfc.section.5.2.1.1.p.1"><p>Argument syntax: <a class="self" href="#rfc.section.5.2.1.1.p.1">&para;</a></p><ul class="empty"><li><a href="#delta-seconds" class="smpl">delta-seconds</a> (see <a href="#delta-seconds" title="Delta Seconds">Section&nbsp;1.2.1</a>)</li></ul></div><div id="rfc.section.5.2.1.1.p.2"><p>The "max-age" request directive indicates that the client is unwilling to accept a response whose age is greater than the specified number of seconds. Unless the max-stale request directive is also present, the client is not willing to accept a stale response.<a class="self" href="#rfc.section.5.2.1.1.p.2">&para;</a></p></div><div id="rfc.section.5.2.1.1.p.3"><p>This directive uses the token form of the argument syntax: e.g., 'max-age=5' not 'max-age="5"'. A sender <em class="bcp14">SHOULD NOT</em> generate the quoted-string form.<a class="self" href="#rfc.section.5.2.1.1.p.3">&para;</a></p></div></div><div id="cache-request-directive.max-stale"><h4 id="rfc.section.5.2.1.2"><a href="#rfc.section.5.2.1.2">5.2.1.2</a>&nbsp;<a href="#cache-request-directive.max-stale">max-stale</a></h4><div id="rfc.section.5.2.1.2.p.1"><p>Argument syntax: <a class="self" href="#rfc.section.5.2.1.2.p.1">&para;</a></p><ul class="empty"><li><a href="#delta-seconds" class="smpl">delta-seconds</a> (see <a href="#delta-seconds" title="Delta Seconds">Section&nbsp;1.2.1</a>)</li></ul></div><div id="rfc.section.5.2.1.2.p.2"><p>The "max-stale" request directive indicates that the client is willing to accept a response that has exceeded its freshness lifetime. If max-stale is assigned a value, then the client is willing to accept a response that has exceeded its freshness lifetime by no more than the specified number of seconds. If no value is assigned to max-stale, then the client is willing to accept a stale response of any age.<a class="self" href="#rfc.section.5.2.1.2.p.2">&para;</a></p></div><div id="rfc.section.5.2.1.2.p.3"><p>This directive uses the token form of the argument syntax: e.g., 'max-stale=10' not 'max-stale="10"'. A sender <em class="bcp14">SHOULD NOT</em> generate the quoted-string form.<a class="self" href="#rfc.section.5.2.1.2.p.3">&para;</a></p></div></div><div id="cache-request-directive.min-fresh"><h4 id="rfc.section.5.2.1.3"><a href="#rfc.section.5.2.1.3">5.2.1.3</a>&nbsp;<a href="#cache-request-directive.min-fresh">min-fresh</a></h4><div id="rfc.section.5.2.1.3.p.1"><p>Argument syntax: <a class="self" href="#rfc.section.5.2.1.3.p.1">&para;</a></p><ul class="empty"><li><a href="#delta-seconds" class="smpl">delta-seconds</a> (see <a href="#delta-seconds" title="Delta Seconds">Section&nbsp;1.2.1</a>)</li></ul></div><div id="rfc.section.5.2.1.3.p.2"><p>The "min-fresh" request directive indicates that the client is willing to accept a response whose freshness lifetime is no less than its current age plus the specified time in seconds. That is, the client wants a response that will still be fresh for at least the specified number of seconds.<a class="self" href="#rfc.section.5.2.1.3.p.2">&para;</a></p></div><div id="rfc.section.5.2.1.3.p.3"><p>This directive uses the token form of the argument syntax: e.g., 'min-fresh=20' not 'min-fresh="20"'. A sender <em class="bcp14">SHOULD NOT</em> generate the quoted-string form.<a class="self" href="#rfc.section.5.2.1.3.p.3">&para;</a></p></div></div><div id="cache-request-directive.no-cache"><h4 id="rfc.section.5.2.1.4"><a href="#rfc.section.5.2.1.4">5.2.1.4</a>&nbsp;<a href="#cache-request-directive.no-cache">no-cache</a></h4><div id="rfc.section.5.2.1.4.p.1"><p>The "no-cache" request directive indicates that a cache <em class="bcp14">MUST NOT</em> use a stored response to satisfy the request without successful validation on the origin server.<a class="self" href="#rfc.section.5.2.1.4.p.1">&para;</a></p></div></div><div id="cache-request-directive.no-store"><h4 id="rfc.section.5.2.1.5"><a href="#rfc.section.5.2.1.5">5.2.1.5</a>&nbsp;<a href="#cache-request-directive.no-store">no-store</a></h4><div id="rfc.section.5.2.1.5.p.1"><p>The "no-store" request directive indicates that a cache <em class="bcp14">MUST NOT</em> store any part of either this request or any response to it. This directive applies to both private and shared caches. "<em class="bcp14">MUST NOT</em> store" in this context means that the cache <em class="bcp14">MUST NOT</em> intentionally store the information in non-volatile storage, and <em class="bcp14">MUST</em> make a best-effort attempt to remove the information from volatile storage as promptly as possible after forwarding it.<a class="self" href="#rfc.section.5.2.1.5.p.1">&para;</a></p></div><div id="rfc.section.5.2.1.5.p.2"><p>This directive is NOT a reliable or sufficient mechanism for ensuring privacy. In particular, malicious or compromised caches might not recognize or obey this directive, and communications networks might be vulnerable to eavesdropping.<a class="self" href="#rfc.section.5.2.1.5.p.2">&para;</a></p></div><div id="rfc.section.5.2.1.5.p.3"><p>Note that if a request containing this directive is satisfied from a cache, the no-store request directive does not apply to the already stored response.<a class="self" href="#rfc.section.5.2.1.5.p.3">&para;</a></p></div></div><div id="cache-request-directive.no-transform"><h4 id="rfc.section.5.2.1.6"><a href="#rfc.section.5.2.1.6">5.2.1.6</a>&nbsp;<a href="#cache-request-directive.no-transform">no-transform</a></h4><div id="rfc.section.5.2.1.6.p.1"><p>The "no-transform" request directive indicates that an intermediary (whether or not it implements a cache) <em class="bcp14">MUST NOT</em> transform the payload, as defined in <a href="rfc7230.html#message.transformations" title="Transformations">Section 5.7.2</a> of <a href="#RFC7230" id="rfc.xref.RFC7230.9"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a>.<a class="self" href="#rfc.section.5.2.1.6.p.1">&para;</a></p></div></div><div id="cache-request-directive.only-if-cached"><h4 id="rfc.section.5.2.1.7"><a href="#rfc.section.5.2.1.7">5.2.1.7</a>&nbsp;<a href="#cache-request-directive.only-if-cached">only-if-cached</a></h4><div id="rfc.section.5.2.1.7.p.1"><p>The "only-if-cached" request directive indicates that the client only wishes to obtain a stored response. If it receives this directive, a cache <em class="bcp14">SHOULD</em> either respond using a stored response that is consistent with the other constraints of the request, or respond with a <a href="rfc7231.html#status.504" class="smpl">504 (Gateway
545   Timeout)</a> status code. If a group of caches is being operated as a unified system with good internal connectivity, a member cache <em class="bcp14">MAY</em> forward such a request within that group of caches.<a class="self" href="#rfc.section.5.2.1.7.p.1">&para;</a></p></div></div></div><div id="cache-response-directive"><h3 id="rfc.section.5.2.2"><a href="#rfc.section.5.2.2">5.2.2</a>&nbsp;<a href="#cache-response-directive">Response Cache-Control Directives</a></h3><div id="cache-response-directive.must-revalidate"><h4 id="rfc.section.5.2.2.1"><a href="#rfc.section.5.2.2.1">5.2.2.1</a>&nbsp;<a href="#cache-response-directive.must-revalidate">must-revalidate</a></h4><div id="rfc.section.5.2.2.1.p.1"><p>The "must-revalidate" response directive indicates that once it has become stale, a cache <em class="bcp14">MUST NOT</em> use the response to satisfy subsequent requests without successful validation on the origin server.<a class="self" href="#rfc.section.5.2.2.1.p.1">&para;</a></p></div><div id="rfc.section.5.2.2.1.p.2"><p>The must-revalidate directive is necessary to support reliable operation for certain protocol features. In all circumstances a cache <em class="bcp14">MUST</em> obey the must-revalidate directive; in particular, if a cache cannot reach the origin server for any reason, it <em class="bcp14">MUST</em> generate a <a href="rfc7231.html#status.504" class="smpl">504 (Gateway Timeout)</a> response.<a class="self" href="#rfc.section.5.2.2.1.p.2">&para;</a></p></div><div id="rfc.section.5.2.2.1.p.3"><p>The must-revalidate directive ought to be used by servers if and only if failure to validate a request on the representation could result in incorrect operation, such as a silently unexecuted financial transaction.<a class="self" href="#rfc.section.5.2.2.1.p.3">&para;</a></p></div></div><div id="cache-response-directive.no-cache"><h4 id="rfc.section.5.2.2.2"><a href="#rfc.section.5.2.2.2">5.2.2.2</a>&nbsp;<a href="#cache-response-directive.no-cache">no-cache</a></h4><div id="rfc.section.5.2.2.2.p.1"><p>Argument syntax: <a class="self" href="#rfc.section.5.2.2.2.p.1">&para;</a></p><ul class="empty"><li>#<a href="#imported.abnf" class="smpl">field-name</a> </li></ul></div><div id="rfc.section.5.2.2.2.p.2"><p>The "no-cache" response directive indicates that the response <em class="bcp14">MUST NOT</em> be used to satisfy a subsequent request without successful validation on the origin server. This allows an origin server to prevent a cache from using it to satisfy a request without contacting it, even by caches that have been configured to send stale responses.<a class="self" href="#rfc.section.5.2.2.2.p.2">&para;</a></p></div><div id="rfc.section.5.2.2.2.p.3"><p>If the no-cache response directive specifies one or more field-names, then a cache <em class="bcp14">MAY</em> use the response to satisfy a subsequent request, subject to any other restrictions on caching. However, any header fields in the response that have the field-name(s) listed <em class="bcp14">MUST NOT</em> be sent in the response to a subsequent request without successful revalidation with the origin server. This allows an origin server to prevent the re-use of certain header fields in a response, while still allowing caching of the rest of the response.<a class="self" href="#rfc.section.5.2.2.2.p.3">&para;</a></p></div><div id="rfc.section.5.2.2.2.p.4"><p>The field-names given are not limited to the set of header fields defined by this specification. Field names are case-insensitive.<a class="self" href="#rfc.section.5.2.2.2.p.4">&para;</a></p></div><div id="rfc.section.5.2.2.2.p.5"><p>This directive uses the quoted-string form of the argument syntax. A sender <em class="bcp14">SHOULD NOT</em> generate the token form (even if quoting appears not to be needed for single-entry lists).<a class="self" href="#rfc.section.5.2.2.2.p.5">&para;</a></p></div><div id="rfc.section.5.2.2.2.p.6"><p><b>Note:</b> Although it has been back-ported to many implementations, some HTTP/1.0 caches will not recognize or obey this directive. Also, no-cache response directives with field-names are often handled by caches as if an unqualified no-cache directive was received; i.e., the special handling for the qualified form is not widely implemented.<a class="self" href="#rfc.section.5.2.2.2.p.6">&para;</a></p></div></div><div id="cache-response-directive.no-store"><h4 id="rfc.section.5.2.2.3"><a href="#rfc.section.5.2.2.3">5.2.2.3</a>&nbsp;<a href="#cache-response-directive.no-store">no-store</a></h4><div id="rfc.section.5.2.2.3.p.1"><p>The "no-store" response directive indicates that a cache <em class="bcp14">MUST NOT</em> store any part of either the immediate request or response. This directive applies to both private and shared caches. "<em class="bcp14">MUST NOT</em> store" in this context means that the cache <em class="bcp14">MUST NOT</em> intentionally store the information in non-volatile storage, and <em class="bcp14">MUST</em> make a best-effort attempt to remove the information from volatile storage as promptly as possible after forwarding it.<a class="self" href="#rfc.section.5.2.2.3.p.1">&para;</a></p></div><div id="rfc.section.5.2.2.3.p.2"><p>This directive is NOT a reliable or sufficient mechanism for ensuring privacy. In particular, malicious or compromised caches might not recognize or obey this directive, and communications networks might be vulnerable to eavesdropping.<a class="self" href="#rfc.section.5.2.2.3.p.2">&para;</a></p></div></div><div id="cache-response-directive.no-transform"><h4 id="rfc.section.5.2.2.4"><a href="#rfc.section.5.2.2.4">5.2.2.4</a>&nbsp;<a href="#cache-response-directive.no-transform">no-transform</a></h4><div id="rfc.section.5.2.2.4.p.1"><p>The "no-transform" response directive indicates that an intermediary (regardless of whether it implements a cache) <em class="bcp14">MUST NOT</em> transform the payload, as defined in <a href="rfc7230.html#message.transformations" title="Transformations">Section 5.7.2</a> of <a href="#RFC7230" id="rfc.xref.RFC7230.10"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a>.<a class="self" href="#rfc.section.5.2.2.4.p.1">&para;</a></p></div></div><div id="cache-response-directive.public"><h4 id="rfc.section.5.2.2.5"><a href="#rfc.section.5.2.2.5">5.2.2.5</a>&nbsp;<a href="#cache-response-directive.public">public</a></h4><div id="rfc.section.5.2.2.5.p.1"><p>The "public" response directive indicates that any cache <em class="bcp14">MAY</em> store the response, even if the response would normally be non-cacheable or cacheable only within a private cache. (See <a href="#caching.authenticated.responses" title="Storing Responses to Authenticated Requests">Section&nbsp;3.2</a> for additional details related to the use of public in response to a request containing <a href="rfc7235.html#header.authorization" class="smpl">Authorization</a>, and <a href="#response.cacheability" title="Storing Responses in Caches">Section&nbsp;3</a> for details of how public affects responses that would normally not be stored, due to their status codes not being defined as cacheable by default; see <a href="#heuristic.freshness" title="Calculating Heuristic Freshness">Section&nbsp;4.2.2</a>.)<a class="self" href="#rfc.section.5.2.2.5.p.1">&para;</a></p></div></div><div id="cache-response-directive.private"><h4 id="rfc.section.5.2.2.6"><a href="#rfc.section.5.2.2.6">5.2.2.6</a>&nbsp;<a href="#cache-response-directive.private">private</a></h4><div id="rfc.section.5.2.2.6.p.1"><p>Argument syntax: <a class="self" href="#rfc.section.5.2.2.6.p.1">&para;</a></p><ul class="empty"><li>#<a href="#imported.abnf" class="smpl">field-name</a> </li></ul></div><div id="rfc.section.5.2.2.6.p.2"><p>The "private" response directive indicates that the response message is intended for a single user and <em class="bcp14">MUST NOT</em> be stored by a shared cache. A private cache <em class="bcp14">MAY</em> store the response and reuse it for later requests, even if the response would normally be non-cacheable.<a class="self" href="#rfc.section.5.2.2.6.p.2">&para;</a></p></div><div id="rfc.section.5.2.2.6.p.3"><p>If the private response directive specifies one or more field-names, this requirement is limited to the field-values associated with the listed response header fields. That is, a shared cache <em class="bcp14">MUST NOT</em> store the specified field-names(s), whereas it <em class="bcp14">MAY</em> store the remainder of the response message.<a class="self" href="#rfc.section.5.2.2.6.p.3">&para;</a></p></div><div id="rfc.section.5.2.2.6.p.4"><p>The field-names given are not limited to the set of header fields defined by this specification. Field names are case-insensitive.<a class="self" href="#rfc.section.5.2.2.6.p.4">&para;</a></p></div><div id="rfc.section.5.2.2.6.p.5"><p>This directive uses the quoted-string form of the argument syntax. A sender <em class="bcp14">SHOULD NOT</em> generate the token form (even if quoting appears not to be needed for single-entry lists).<a class="self" href="#rfc.section.5.2.2.6.p.5">&para;</a></p></div><div id="rfc.section.5.2.2.6.p.6"><p><b>Note:</b> This usage of the word "private" only controls where the response can be stored; it cannot ensure the privacy of the message content. Also, private response directives with field-names are often handled by caches as if an unqualified private directive was received; i.e., the special handling for the qualified form is not widely implemented.<a class="self" href="#rfc.section.5.2.2.6.p.6">&para;</a></p></div></div><div id="cache-response-directive.proxy-revalidate"><h4 id="rfc.section.5.2.2.7"><a href="#rfc.section.5.2.2.7">5.2.2.7</a>&nbsp;<a href="#cache-response-directive.proxy-revalidate">proxy-revalidate</a></h4><div id="rfc.section.5.2.2.7.p.1"><p>The "proxy-revalidate" response directive has the same meaning as the must-revalidate response directive, except that it does not apply to private caches.<a class="self" href="#rfc.section.5.2.2.7.p.1">&para;</a></p></div></div><div id="cache-response-directive.max-age"><h4 id="rfc.section.5.2.2.8"><a href="#rfc.section.5.2.2.8">5.2.2.8</a>&nbsp;<a href="#cache-response-directive.max-age">max-age</a></h4><div id="rfc.section.5.2.2.8.p.1"><p>Argument syntax: <a class="self" href="#rfc.section.5.2.2.8.p.1">&para;</a></p><ul class="empty"><li><a href="#delta-seconds" class="smpl">delta-seconds</a> (see <a href="#delta-seconds" title="Delta Seconds">Section&nbsp;1.2.1</a>)</li></ul></div><div id="rfc.section.5.2.2.8.p.2"><p>The "max-age" response directive indicates that the response is to be considered stale after its age is greater than the specified number of seconds.<a class="self" href="#rfc.section.5.2.2.8.p.2">&para;</a></p></div><div id="rfc.section.5.2.2.8.p.3"><p>This directive uses the token form of the argument syntax: e.g., 'max-age=5' not 'max-age="5"'. A sender <em class="bcp14">SHOULD NOT</em> generate the quoted-string form.<a class="self" href="#rfc.section.5.2.2.8.p.3">&para;</a></p></div></div><div id="cache-response-directive.s-maxage"><h4 id="rfc.section.5.2.2.9"><a href="#rfc.section.5.2.2.9">5.2.2.9</a>&nbsp;<a href="#cache-response-directive.s-maxage">s-maxage</a></h4><div id="rfc.section.5.2.2.9.p.1"><p>Argument syntax: <a class="self" href="#rfc.section.5.2.2.9.p.1">&para;</a></p><ul class="empty"><li><a href="#delta-seconds" class="smpl">delta-seconds</a> (see <a href="#delta-seconds" title="Delta Seconds">Section&nbsp;1.2.1</a>)</li></ul></div><div id="rfc.section.5.2.2.9.p.2"><p>The "s-maxage" response directive indicates that, in shared caches, the maximum age specified by this directive overrides the maximum age specified by either the max-age directive or the <a href="#header.expires" class="smpl">Expires</a> header field. The s-maxage directive also implies the semantics of the proxy-revalidate response directive.<a class="self" href="#rfc.section.5.2.2.9.p.2">&para;</a></p></div><div id="rfc.section.5.2.2.9.p.3"><p>This directive uses the token form of the argument syntax: e.g., 's-maxage=10' not 's-maxage="10"'. A sender <em class="bcp14">SHOULD NOT</em> generate the quoted-string form.<a class="self" href="#rfc.section.5.2.2.9.p.3">&para;</a></p></div></div></div><div id="cache.control.extensions"><h3 id="rfc.section.5.2.3"><a href="#rfc.section.5.2.3">5.2.3</a>&nbsp;<a href="#cache.control.extensions">Cache Control Extensions</a></h3><div id="rfc.section.5.2.3.p.1"><p>The Cache-Control header field can be extended through the use of one or more cache-extension tokens, each with an optional value. A cache <em class="bcp14">MUST</em> ignore unrecognized cache directives.<a class="self" href="#rfc.section.5.2.3.p.1">&para;</a></p></div><div id="rfc.section.5.2.3.p.2"><p>Informational extensions (those that do not require a change in cache behavior) can be added without changing the semantics of other directives.<a class="self" href="#rfc.section.5.2.3.p.2">&para;</a></p></div><div id="rfc.section.5.2.3.p.3"><p>Behavioral extensions are designed to work by acting as modifiers to the existing base of cache directives. Both the new directive and the old directive are supplied, such that applications that do not understand the new directive will default to the behavior specified by the old directive, and those that understand the new directive will recognize it as modifying the requirements associated with the old directive. In this way, extensions to the existing cache-control directives can be made without breaking deployed caches.<a class="self" href="#rfc.section.5.2.3.p.3">&para;</a></p></div><div id="rfc.section.5.2.3.p.4"><p>For example, consider a hypothetical new response directive called "community" that acts as a modifier to the private directive: in addition to private caches, any cache that is shared only by members of the named community is allowed to cache the response. An origin server wishing to allow the UCI community to use an otherwise private response in their shared cache(s) could do so by including<a class="self" href="#rfc.section.5.2.3.p.4">&para;</a></p></div><div id="rfc.figure.u.8"><pre class="text">  Cache-Control: private, community="UCI"
546</pre></div><div id="rfc.section.5.2.3.p.5"><p>A cache that recognizes such a community cache-extension could broaden its behavior in accordance with that extension. A cache that does not recognize the community cache-extension would ignore it and adhere to the private directive.<a class="self" href="#rfc.section.5.2.3.p.5">&para;</a></p></div></div></div><div id="header.expires"><h2 id="rfc.section.5.3"><a href="#rfc.section.5.3">5.3</a>&nbsp;<a href="#header.expires">Expires</a></h2><div id="rfc.section.5.3.p.1"><p>The "Expires" header field gives the date/time after which the response is considered stale. See <a href="#expiration.model" title="Freshness">Section&nbsp;4.2</a> for further discussion of the freshness model.<a class="self" href="#rfc.section.5.3.p.1">&para;</a></p></div><div id="rfc.section.5.3.p.2"><p>The presence of an Expires field does not imply that the original resource will change or cease to exist at, before, or after that time.<a class="self" href="#rfc.section.5.3.p.2">&para;</a></p></div><div id="rfc.section.5.3.p.3"><p>The Expires value is an HTTP-date timestamp, as defined in <a href="rfc7231.html#http.date" title="Date/Time Formats">Section 7.1.1.1</a> of <a href="#RFC7231" id="rfc.xref.RFC7231.8"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[RFC7231]</cite></a>.<a class="self" href="#rfc.section.5.3.p.3">&para;</a></p></div><div id="rfc.figure.u.9"><pre class="inline"><span id="rfc.iref.g.5"></span>  <a href="#header.expires" class="smpl">Expires</a> = <a href="#imported.abnf" class="smpl">HTTP-date</a>
547</pre></div><div id="rfc.figure.u.10"><p>For example</p><pre class="text">  Expires: Thu, 01 Dec 1994 16:00:00 GMT
548</pre></div><div id="rfc.section.5.3.p.4"><p>A cache recipient <em class="bcp14">MUST</em> interpret invalid date formats, especially the value "0", as representing a time in the past (i.e., "already expired").<a class="self" href="#rfc.section.5.3.p.4">&para;</a></p></div><div id="rfc.section.5.3.p.5"><p>If a response includes a <a href="#header.cache-control" class="smpl">Cache-Control</a> field with the max-age directive (<a href="#cache-response-directive.max-age" title="max-age">Section&nbsp;5.2.2.8</a>), a recipient <em class="bcp14">MUST</em> ignore the Expires field. Likewise, if a response includes the s-maxage directive (<a href="#cache-response-directive.s-maxage" title="s-maxage">Section&nbsp;5.2.2.9</a>), a shared cache recipient <em class="bcp14">MUST</em> ignore the Expires field. In both these cases, the value in Expires is only intended for recipients that have not yet implemented the Cache-Control field.<a class="self" href="#rfc.section.5.3.p.5">&para;</a></p></div><div id="rfc.section.5.3.p.6"><p>An origin server without a clock <em class="bcp14">MUST NOT</em> generate an Expires field unless its value represents a fixed time in the past (always expired) or its value has been associated with the resource by a system or user with a reliable clock.<a class="self" href="#rfc.section.5.3.p.6">&para;</a></p></div><div id="rfc.section.5.3.p.7"><p>Historically, HTTP required the Expires field-value to be no more than a year in the future. While longer freshness lifetimes are no longer prohibited, extremely large values have been demonstrated to cause problems (e.g., clock overflows due to use of 32-bit integers for time values), and many caches will evict a response far sooner than that.<a class="self" href="#rfc.section.5.3.p.7">&para;</a></p></div></div><div id="header.pragma"><h2 id="rfc.section.5.4"><a href="#rfc.section.5.4">5.4</a>&nbsp;<a href="#header.pragma">Pragma</a></h2><div id="rfc.section.5.4.p.1"><p>The "Pragma" header field allows backwards compatibility with HTTP/1.0 caches, so that clients can specify a "no-cache" request that they will understand (as <a href="#header.cache-control" class="smpl">Cache-Control</a> was not defined until HTTP/1.1). When the Cache-Control header field is also present and understood in a request, Pragma is ignored.<a class="self" href="#rfc.section.5.4.p.1">&para;</a></p></div><div id="rfc.section.5.4.p.2"><p>In HTTP/1.0, Pragma was defined as an extensible field for implementation-specified directives for recipients. This specification deprecates such extensions to improve interoperability.<a class="self" href="#rfc.section.5.4.p.2">&para;</a></p></div><div id="rfc.figure.u.11"><pre class="inline"><span id="rfc.iref.g.6"></span><span id="rfc.iref.g.7"></span><span id="rfc.iref.g.8"></span>  <a href="#header.pragma" class="smpl">Pragma</a>           = 1#<a href="#header.pragma" class="smpl">pragma-directive</a>
549  <a href="#header.pragma" class="smpl">pragma-directive</a> = "no-cache" / <a href="#header.pragma" class="smpl">extension-pragma</a>
550  <a href="#header.pragma" class="smpl">extension-pragma</a> = <a href="#imported.abnf" class="smpl">token</a> [ "=" ( <a href="#imported.abnf" class="smpl">token</a> / <a href="#imported.abnf" class="smpl">quoted-string</a> ) ]
551</pre></div><div id="rfc.section.5.4.p.3"><p>When the <a href="#header.cache-control" class="smpl">Cache-Control</a> header field is not present in a request, caches <em class="bcp14">MUST</em> consider the no-cache request pragma-directive as having the same effect as if "Cache-Control: no-cache" were present (see <a href="#cache-request-directive" title="Request Cache-Control Directives">Section&nbsp;5.2.1</a>).<a class="self" href="#rfc.section.5.4.p.3">&para;</a></p></div><div id="rfc.section.5.4.p.4"><p>When sending a no-cache request, a client ought to include both the pragma and cache-control directives, unless Cache-Control: no-cache is purposefully omitted to target other <a href="#header.cache-control" class="smpl">Cache-Control</a> response directives at HTTP/1.1 caches. For example:<a class="self" href="#rfc.section.5.4.p.4">&para;</a></p></div><div id="rfc.figure.u.12"><pre class="text">GET / HTTP/1.1
552Host: www.example.com
553Cache-Control: max-age=30
554Pragma: no-cache
555
556</pre></div><div id="rfc.section.5.4.p.5"><p>will constrain HTTP/1.1 caches to serve a response no older than 30 seconds, while precluding implementations that do not understand <a href="#header.cache-control" class="smpl">Cache-Control</a> from serving a cached response.<a class="self" href="#rfc.section.5.4.p.5">&para;</a></p></div><div class="note"><div id="rfc.section.5.4.p.6"><p><b>Note:</b> Because the meaning of "Pragma: no-cache" in responses is not specified, it does not provide a reliable replacement for "Cache-Control: no-cache" in them.<a class="self" href="#rfc.section.5.4.p.6">&para;</a></p></div></div></div><div id="header.warning"><h2 id="rfc.section.5.5"><a href="#rfc.section.5.5">5.5</a>&nbsp;<a href="#header.warning">Warning</a></h2><div id="rfc.section.5.5.p.1"><p>The "Warning" header field is used to carry additional information about the status or transformation of a message that might not be reflected in the status code. This information is typically used to warn about possible incorrectness introduced by caching operations or transformations applied to the payload of the message.<a class="self" href="#rfc.section.5.5.p.1">&para;</a></p></div><div id="rfc.section.5.5.p.2"><p>Warnings can be used for other purposes, both cache-related and otherwise. The use of a warning, rather than an error status code, distinguishes these responses from true failures.<a class="self" href="#rfc.section.5.5.p.2">&para;</a></p></div><div id="rfc.section.5.5.p.3"><p>Warning header fields can in general be applied to any message, however some warn-codes are specific to caches and can only be applied to response messages.<a class="self" href="#rfc.section.5.5.p.3">&para;</a></p></div><div id="rfc.figure.u.13"><pre class="inline"><span id="rfc.iref.g.9"></span><span id="rfc.iref.g.10"></span><span id="rfc.iref.g.11"></span><span id="rfc.iref.g.12"></span><span id="rfc.iref.g.13"></span><span id="rfc.iref.g.14"></span>  <a href="#header.warning" class="smpl">Warning</a>       = 1#<a href="#header.warning" class="smpl">warning-value</a>
557 
558  <a href="#header.warning" class="smpl">warning-value</a> = <a href="#header.warning" class="smpl">warn-code</a> <a href="#imported.abnf" class="smpl">SP</a> <a href="#header.warning" class="smpl">warn-agent</a> <a href="#imported.abnf" class="smpl">SP</a> <a href="#header.warning" class="smpl">warn-text</a>
559                                        [ <a href="#imported.abnf" class="smpl">SP</a> <a href="#header.warning" class="smpl">warn-date</a> ]
560 
561  <a href="#header.warning" class="smpl">warn-code</a>  = 3<a href="#imported.abnf" class="smpl">DIGIT</a>
562  <a href="#header.warning" class="smpl">warn-agent</a> = ( <a href="#imported.abnf" class="smpl">uri-host</a> [ ":" <a href="#imported.abnf" class="smpl">port</a> ] ) / <a href="#imported.abnf" class="smpl">pseudonym</a>
563                  ; the name or pseudonym of the server adding
564                  ; the Warning header field, for use in debugging
565                  ; a single "-" is recommended when agent unknown
566  <a href="#header.warning" class="smpl">warn-text</a>  = <a href="#imported.abnf" class="smpl">quoted-string</a>
567  <a href="#header.warning" class="smpl">warn-date</a>  = <a href="#imported.abnf" class="smpl">DQUOTE</a> <a href="#imported.abnf" class="smpl">HTTP-date</a> <a href="#imported.abnf" class="smpl">DQUOTE</a>
568</pre></div><div id="rfc.section.5.5.p.4"><p>Multiple warnings can be generated in a response (either by the origin server or by a cache), including multiple warnings with the same warn-code number that only differ in warn-text.<a class="self" href="#rfc.section.5.5.p.4">&para;</a></p></div><div id="rfc.section.5.5.p.5"><p>A user agent that receives one or more Warning header fields <em class="bcp14">SHOULD</em> inform the user of as many of them as possible, in the order that they appear in the response. Senders that generate multiple Warning header fields are encouraged to order them with this user agent behavior in mind. A sender that generates new Warning header fields <em class="bcp14">MUST</em> append them after any existing Warning header fields.<a class="self" href="#rfc.section.5.5.p.5">&para;</a></p></div><div id="rfc.section.5.5.p.6"><p>Warnings are assigned three digit warn-codes. The first digit indicates whether the Warning is required to be deleted from a stored response after validation: <a class="self" href="#rfc.section.5.5.p.6">&para;</a></p><ul><li>1xx warn-codes describe the freshness or validation status of the response, and so they <em class="bcp14">MUST</em> be deleted by a cache after validation. They can only be generated by a cache when validating a cached entry, and <em class="bcp14">MUST NOT</em> be generated in any other situation.</li><li>2xx warn-codes describe some aspect of the representation that is not rectified by a validation (for example, a lossy compression of the representation) and they <em class="bcp14">MUST NOT</em> be deleted by a cache after validation, unless a full response is sent, in which case they <em class="bcp14">MUST</em> be.</li></ul></div><div id="rfc.section.5.5.p.7"><p>If a sender generates one or more 1xx warn-codes in a message to be sent to a recipient known to implement only HTTP/1.0, the sender <em class="bcp14">MUST</em> include in each corresponding warning-value a warn-date that matches the <a href="rfc7231.html#header.date" class="smpl">Date</a> header field in the message. For example:<a class="self" href="#rfc.section.5.5.p.7">&para;</a></p></div><div id="rfc.figure.u.14"><pre class="text">HTTP/1.1 200 OK
569Date: Sat, 25 Aug 2012 23:34:45 GMT
570Warning: 112 - "network down" "Sat, 25 Aug 2012 23:34:45 GMT"
571
572</pre></div><div id="rfc.section.5.5.p.8"><p>Warnings have accompanying warn-text that describes the error, e.g., for logging. It is advisory only, and its content does not affect interpretation of the warn-code.<a class="self" href="#rfc.section.5.5.p.8">&para;</a></p></div><div id="rfc.section.5.5.p.9"><p>If a recipient that uses, evaluates, or displays Warning header fields receives a warn-date that is different from the <a href="rfc7231.html#header.date" class="smpl">Date</a> value in the same message, the recipient <em class="bcp14">MUST</em> exclude the warning-value containing that warn-date before storing, forwarding, or using the message. This allows recipients to exclude warning-values that were improperly retained after a cache validation. If all of the warning-values are excluded, the recipient <em class="bcp14">MUST</em> exclude the Warning header field as well.<a class="self" href="#rfc.section.5.5.p.9">&para;</a></p></div><div id="rfc.section.5.5.p.10"><p>The following warn-codes are defined by this specification, each with a recommended warn-text in English, and a description of its meaning. The procedure for defining additional warn codes is described in <a href="#warn.code.registry.procedure" title="Procedure">Section&nbsp;7.2.1</a>.<a class="self" href="#rfc.section.5.5.p.10">&para;</a></p></div><div id="warn.110"><h3 id="rfc.section.5.5.1"><a href="#rfc.section.5.5.1">5.5.1</a>&nbsp;<a href="#warn.110">Warning: 110 - "Response is Stale"</a></h3><div id="rfc.section.5.5.1.p.1"><p>A cache <em class="bcp14">SHOULD</em> generate this whenever the sent response is stale.<a class="self" href="#rfc.section.5.5.1.p.1">&para;</a></p></div></div><div id="warn.111"><h3 id="rfc.section.5.5.2"><a href="#rfc.section.5.5.2">5.5.2</a>&nbsp;<a href="#warn.111">Warning: 111 - "Revalidation Failed"</a></h3><div id="rfc.section.5.5.2.p.1"><p>A cache <em class="bcp14">SHOULD</em> generate this when sending a stale response because an attempt to validate the response failed, due to an inability to reach the server.<a class="self" href="#rfc.section.5.5.2.p.1">&para;</a></p></div></div><div id="warn.112"><h3 id="rfc.section.5.5.3"><a href="#rfc.section.5.5.3">5.5.3</a>&nbsp;<a href="#warn.112">Warning: 112 - "Disconnected Operation"</a></h3><div id="rfc.section.5.5.3.p.1"><p>A cache <em class="bcp14">SHOULD</em> generate this if it is intentionally disconnected from the rest of the network for a period of time.<a class="self" href="#rfc.section.5.5.3.p.1">&para;</a></p></div></div><div id="warn.113"><h3 id="rfc.section.5.5.4"><a href="#rfc.section.5.5.4">5.5.4</a>&nbsp;<a href="#warn.113">Warning: 113 - "Heuristic Expiration"</a></h3><div id="rfc.section.5.5.4.p.1"><p>A cache <em class="bcp14">SHOULD</em> generate this if it heuristically chose a freshness lifetime greater than 24 hours and the response's age is greater than 24 hours.<a class="self" href="#rfc.section.5.5.4.p.1">&para;</a></p></div></div><div id="warn.199"><h3 id="rfc.section.5.5.5"><a href="#rfc.section.5.5.5">5.5.5</a>&nbsp;<a href="#warn.199">Warning: 199 - "Miscellaneous Warning"</a></h3><div id="rfc.section.5.5.5.p.1"><p>The warning text can include arbitrary information to be presented to a human user or logged. A system receiving this warning <em class="bcp14">MUST NOT</em> take any automated action, besides presenting the warning to the user.<a class="self" href="#rfc.section.5.5.5.p.1">&para;</a></p></div></div><div id="warn.214"><h3 id="rfc.section.5.5.6"><a href="#rfc.section.5.5.6">5.5.6</a>&nbsp;<a href="#warn.214">Warning: 214 - "Transformation Applied"</a></h3><div id="rfc.section.5.5.6.p.1"><p>This Warning code <em class="bcp14">MUST</em> be added by a proxy if it applies any transformation to the representation, such as changing the content-coding, media-type, or modifying the representation data, unless this Warning code already appears in the response.<a class="self" href="#rfc.section.5.5.6.p.1">&para;</a></p></div></div><div id="warn.299"><h3 id="rfc.section.5.5.7"><a href="#rfc.section.5.5.7">5.5.7</a>&nbsp;<a href="#warn.299">Warning: 299 - "Miscellaneous Persistent Warning"</a></h3><div id="rfc.section.5.5.7.p.1"><p>The warning text can include arbitrary information to be presented to a human user or logged. A system receiving this warning <em class="bcp14">MUST NOT</em> take any automated action.<a class="self" href="#rfc.section.5.5.7.p.1">&para;</a></p></div></div></div></div><div id="history.lists"><h1 id="rfc.section.6"><a href="#rfc.section.6">6.</a>&nbsp;<a href="#history.lists">History Lists</a></h1><div id="rfc.section.6.p.1"><p>User agents often have history mechanisms, such as "Back" buttons and history lists, that can be used to redisplay a representation retrieved earlier in a session.<a class="self" href="#rfc.section.6.p.1">&para;</a></p></div><div id="rfc.section.6.p.2"><p>The freshness model (<a href="#expiration.model" title="Freshness">Section&nbsp;4.2</a>) does not necessarily apply to history mechanisms. That is, a history mechanism can display a previous representation even if it has expired.<a class="self" href="#rfc.section.6.p.2">&para;</a></p></div><div id="rfc.section.6.p.3"><p>This does not prohibit the history mechanism from telling the user that a view might be stale or from honoring cache directives (e.g., Cache-Control: no-store).<a class="self" href="#rfc.section.6.p.3">&para;</a></p></div></div><div id="iana.considerations"><h1 id="rfc.section.7"><a href="#rfc.section.7">7.</a>&nbsp;<a href="#iana.considerations">IANA Considerations</a></h1><div id="cache.directive.registry"><h2 id="rfc.section.7.1"><a href="#rfc.section.7.1">7.1</a>&nbsp;<a href="#cache.directive.registry">Cache Directive Registry</a></h2><div id="rfc.section.7.1.p.1"><p>The "Hypertext Transfer Protocol (HTTP) Cache Directive Registry" defines the namespace for the cache directives. It has been created and is now maintained at &lt;<a href="http://www.iana.org/assignments/http-cache-directives">http://www.iana.org/assignments/http-cache-directives</a>&gt;.<a class="self" href="#rfc.section.7.1.p.1">&para;</a></p></div><div id="cache.directive.registry.procedure"><h3 id="rfc.section.7.1.1"><a href="#rfc.section.7.1.1">7.1.1</a>&nbsp;<a href="#cache.directive.registry.procedure">Procedure</a></h3><div id="rfc.section.7.1.1.p.1"><p>A registration <em class="bcp14">MUST</em> include the following fields: <a class="self" href="#rfc.section.7.1.1.p.1">&para;</a></p><ul><li>Cache Directive Name</li><li>Pointer to specification text</li></ul></div><div id="rfc.section.7.1.1.p.2"><p>Values to be added to this namespace require IETF Review (see <a href="#RFC5226" id="rfc.xref.RFC5226.1"><cite title="Guidelines for Writing an IANA Considerations Section in RFCs">[RFC5226]</cite></a>, <a href="https://tools.ietf.org/html/rfc5226#section-4.1">Section 4.1</a>).<a class="self" href="#rfc.section.7.1.1.p.2">&para;</a></p></div></div><div id="cache.directive.considerations"><h3 id="rfc.section.7.1.2"><a href="#rfc.section.7.1.2">7.1.2</a>&nbsp;<a href="#cache.directive.considerations">Considerations for New Cache Control Directives</a></h3><div id="rfc.section.7.1.2.p.1"><p>New extension directives ought to consider defining:<a class="self" href="#rfc.section.7.1.2.p.1">&para;</a></p></div><div id="rfc.section.7.1.2.p.2"><ul><li>What it means for a directive to be specified multiple times,</li><li>When the directive does not take an argument, what it means when an argument is present,</li><li>When the directive requires an argument, what it means when it is missing,</li><li>Whether the directive is specific to requests, responses, or able to be used in either.</li></ul></div><div id="rfc.section.7.1.2.p.3"><p>See also <a href="#cache.control.extensions" title="Cache Control Extensions">Section&nbsp;5.2.3</a>.<a class="self" href="#rfc.section.7.1.2.p.3">&para;</a></p></div></div><div id="cache.directive.registration"><h3 id="rfc.section.7.1.3"><a href="#rfc.section.7.1.3">7.1.3</a>&nbsp;<a href="#cache.directive.registration">Registrations</a></h3><div id="rfc.section.7.1.3.p.1"><p>The registry has been populated with the registrations below:<a class="self" href="#rfc.section.7.1.3.p.1">&para;</a></p></div><div id="rfc.table.1"><div id="iana.cache.directive.registration.table"></div><table class="tt full left" cellpadding="3" cellspacing="0"><thead><tr><th>Cache Directive</th><th>Reference</th></tr></thead><tbody><tr><td class="left">max-age</td><td class="left"><a href="#cache-request-directive.max-age" title="max-age">Section&nbsp;5.2.1.1</a>, <a href="#cache-response-directive.max-age" title="max-age">Section&nbsp;5.2.2.8</a> </td></tr><tr><td class="left">max-stale</td><td class="left"><a href="#cache-request-directive.max-stale" title="max-stale">Section&nbsp;5.2.1.2</a> </td></tr><tr><td class="left">min-fresh</td><td class="left"><a href="#cache-request-directive.min-fresh" title="min-fresh">Section&nbsp;5.2.1.3</a> </td></tr><tr><td class="left">must-revalidate</td><td class="left"><a href="#cache-response-directive.must-revalidate" title="must-revalidate">Section&nbsp;5.2.2.1</a> </td></tr><tr><td class="left">no-cache</td><td class="left"><a href="#cache-request-directive.no-cache" title="no-cache">Section&nbsp;5.2.1.4</a>, <a href="#cache-response-directive.no-cache" title="no-cache">Section&nbsp;5.2.2.2</a> </td></tr><tr><td class="left">no-store</td><td class="left"><a href="#cache-request-directive.no-store" title="no-store">Section&nbsp;5.2.1.5</a>, <a href="#cache-response-directive.no-store" title="no-store">Section&nbsp;5.2.2.3</a> </td></tr><tr><td class="left">no-transform</td><td class="left"><a href="#cache-request-directive.no-transform" title="no-transform">Section&nbsp;5.2.1.6</a>, <a href="#cache-response-directive.no-transform" title="no-transform">Section&nbsp;5.2.2.4</a> </td></tr><tr><td class="left">only-if-cached</td><td class="left"><a href="#cache-request-directive.only-if-cached" title="only-if-cached">Section&nbsp;5.2.1.7</a> </td></tr><tr><td class="left">private</td><td class="left"><a href="#cache-response-directive.private" title="private">Section&nbsp;5.2.2.6</a> </td></tr><tr><td class="left">proxy-revalidate</td><td class="left"><a href="#cache-response-directive.proxy-revalidate" title="proxy-revalidate">Section&nbsp;5.2.2.7</a> </td></tr><tr><td class="left">public</td><td class="left"><a href="#cache-response-directive.public" title="public">Section&nbsp;5.2.2.5</a> </td></tr><tr><td class="left">s-maxage</td><td class="left"><a href="#cache-response-directive.s-maxage" title="s-maxage">Section&nbsp;5.2.2.9</a> </td></tr><tr><td class="left">stale-if-error</td><td class="left"><a href="#RFC5861" id="rfc.xref.RFC5861.1"><cite title="HTTP Cache-Control Extensions for Stale Content">[RFC5861]</cite></a>, <a href="https://tools.ietf.org/html/rfc5861#section-4">Section 4</a> </td></tr><tr><td class="left">stale-while-revalidate</td><td class="left"><a href="#RFC5861" id="rfc.xref.RFC5861.2"><cite title="HTTP Cache-Control Extensions for Stale Content">[RFC5861]</cite></a>, <a href="https://tools.ietf.org/html/rfc5861#section-3">Section 3</a> </td></tr></tbody></table></div></div></div><div id="warn.code.registry"><h2 id="rfc.section.7.2"><a href="#rfc.section.7.2">7.2</a>&nbsp;<a href="#warn.code.registry">Warn Code Registry</a></h2><div id="rfc.section.7.2.p.1"><p>The "Hypertext Transfer Protocol (HTTP) Warn Codes" registry defines the namespace for warn codes. It has been created and is now maintained at &lt;<a href="http://www.iana.org/assignments/http-warn-codes">http://www.iana.org/assignments/http-warn-codes</a>&gt;.<a class="self" href="#rfc.section.7.2.p.1">&para;</a></p></div><div id="warn.code.registry.procedure"><h3 id="rfc.section.7.2.1"><a href="#rfc.section.7.2.1">7.2.1</a>&nbsp;<a href="#warn.code.registry.procedure">Procedure</a></h3><div id="rfc.section.7.2.1.p.1"><p>A registration <em class="bcp14">MUST</em> include the following fields: <a class="self" href="#rfc.section.7.2.1.p.1">&para;</a></p><ul><li>Warn Code (3 digits)</li><li>Short Description</li><li>Pointer to specification text</li></ul></div><div id="rfc.section.7.2.1.p.2"><p>Values to be added to this namespace require IETF Review (see <a href="#RFC5226" id="rfc.xref.RFC5226.2"><cite title="Guidelines for Writing an IANA Considerations Section in RFCs">[RFC5226]</cite></a>, <a href="https://tools.ietf.org/html/rfc5226#section-4.1">Section 4.1</a>).<a class="self" href="#rfc.section.7.2.1.p.2">&para;</a></p></div></div><div id="warn.code.registration"><h3 id="rfc.section.7.2.2"><a href="#rfc.section.7.2.2">7.2.2</a>&nbsp;<a href="#warn.code.registration">Registrations</a></h3><div id="rfc.section.7.2.2.p.1"><p>The registry has been populated with the registrations below:<a class="self" href="#rfc.section.7.2.2.p.1">&para;</a></p></div><div id="rfc.table.2"><div id="iana.warn.code.registration.table"></div><table class="tt full left" cellpadding="3" cellspacing="0"><thead><tr><th>Warn Code</th><th>Short Description</th><th>Reference</th></tr></thead><tbody><tr><td class="left">110</td><td class="left">Response is Stale</td><td class="left"><a href="#warn.110" id="rfc.xref.warn.110.2" title="Warning: 110 - &#34;Response is Stale&#34;">Section&nbsp;5.5.1</a> </td></tr><tr><td class="left">111</td><td class="left">Revalidation Failed</td><td class="left"><a href="#warn.111" id="rfc.xref.warn.111.1" title="Warning: 111 - &#34;Revalidation Failed&#34;">Section&nbsp;5.5.2</a> </td></tr><tr><td class="left">112</td><td class="left">Disconnected Operation</td><td class="left"><a href="#warn.112" id="rfc.xref.warn.112.2" title="Warning: 112 - &#34;Disconnected Operation&#34;">Section&nbsp;5.5.3</a> </td></tr><tr><td class="left">113</td><td class="left">Heuristic Expiration</td><td class="left"><a href="#warn.113" id="rfc.xref.warn.113.2" title="Warning: 113 - &#34;Heuristic Expiration&#34;">Section&nbsp;5.5.4</a> </td></tr><tr><td class="left">199</td><td class="left">Miscellaneous Warning</td><td class="left"><a href="#warn.199" id="rfc.xref.warn.199.1" title="Warning: 199 - &#34;Miscellaneous Warning&#34;">Section&nbsp;5.5.5</a> </td></tr><tr><td class="left">214</td><td class="left">Transformation Applied</td><td class="left"><a href="#warn.214" id="rfc.xref.warn.214.1" title="Warning: 214 - &#34;Transformation Applied&#34;">Section&nbsp;5.5.6</a> </td></tr><tr><td class="left">299</td><td class="left">Miscellaneous Persistent Warning</td><td class="left"><a href="#warn.299" id="rfc.xref.warn.299.1" title="Warning: 299 - &#34;Miscellaneous Persistent Warning&#34;">Section&nbsp;5.5.7</a> </td></tr></tbody></table></div></div></div><div id="header.field.registration"><h2 id="rfc.section.7.3"><a href="#rfc.section.7.3">7.3</a>&nbsp;<a href="#header.field.registration">Header Field Registration</a></h2><div id="rfc.section.7.3.p.1"><p>HTTP header fields are registered within the "Message Headers" registry maintained at &lt;<a href="http://www.iana.org/assignments/message-headers/">http://www.iana.org/assignments/message-headers/</a>&gt;.<a class="self" href="#rfc.section.7.3.p.1">&para;</a></p></div><div id="rfc.section.7.3.p.2"><p>This document defines the following HTTP header fields, so the "Permanent Message Header Field Names" registry has been updated accordingly (see <a href="#BCP90" id="rfc.xref.BCP90.1"><cite title="Registration Procedures for Message Header Fields">[BCP90]</cite></a>).<a class="self" href="#rfc.section.7.3.p.2">&para;</a></p></div><div id="rfc.table.3"><div id="iana.header.registration.table"></div><table class="tt full left" cellpadding="3" cellspacing="0"><thead><tr><th>Header Field Name</th><th>Protocol</th><th>Status</th><th>Reference</th></tr></thead><tbody><tr><td class="left">Age</td><td class="left">http</td><td class="left">standard</td><td class="left"><a href="#header.age" id="rfc.xref.header.age.3" title="Age">Section&nbsp;5.1</a> </td></tr><tr><td class="left">Cache-Control</td><td class="left">http</td><td class="left">standard</td><td class="left"><a href="#header.cache-control" id="rfc.xref.header.cache-control.2" title="Cache-Control">Section&nbsp;5.2</a> </td></tr><tr><td class="left">Expires</td><td class="left">http</td><td class="left">standard</td><td class="left"><a href="#header.expires" id="rfc.xref.header.expires.4" title="Expires">Section&nbsp;5.3</a> </td></tr><tr><td class="left">Pragma</td><td class="left">http</td><td class="left">standard</td><td class="left"><a href="#header.pragma" id="rfc.xref.header.pragma.2" title="Pragma">Section&nbsp;5.4</a> </td></tr><tr><td class="left">Warning</td><td class="left">http</td><td class="left">standard</td><td class="left"><a href="#header.warning" id="rfc.xref.header.warning.4" title="Warning">Section&nbsp;5.5</a> </td></tr></tbody></table></div><div id="rfc.section.7.3.p.3"><p>The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".<a class="self" href="#rfc.section.7.3.p.3">&para;</a></p></div></div></div><div id="security.considerations"><h1 id="rfc.section.8"><a href="#rfc.section.8">8.</a>&nbsp;<a href="#security.considerations">Security Considerations</a></h1><div id="rfc.section.8.p.1"><p>This section is meant to inform developers, information providers, and users of known security concerns specific to HTTP caching. More general security considerations are addressed in HTTP messaging <a href="#RFC7230" id="rfc.xref.RFC7230.11"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a> and semantics <a href="#RFC7231" id="rfc.xref.RFC7231.9"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[RFC7231]</cite></a>.<a class="self" href="#rfc.section.8.p.1">&para;</a></p></div><div id="rfc.section.8.p.2"><p>Caches expose additional potential vulnerabilities, since the contents of the cache represent an attractive target for malicious exploitation. Because cache contents persist after an HTTP request is complete, an attack on the cache can reveal information long after a user believes that the information has been removed from the network. Therefore, cache contents need to be protected as sensitive information.<a class="self" href="#rfc.section.8.p.2">&para;</a></p></div><div id="rfc.section.8.p.3"><p>In particular, various attacks might be amplified by being stored in a shared cache; such "cache poisoning" attacks use the cache to distribute a malicious payload to many clients, and are especially effective when an attacker can use implementation flaws, elevated privileges, or other techniques to insert such a response into a cache. One common attack vector for cache poisoning is to exploit differences in message parsing on proxies and in user agents; see <a href="rfc7230.html#message.body.length" title="Message Body Length">Section 3.3.3</a> of <a href="#RFC7230" id="rfc.xref.RFC7230.12"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a> for the relevant requirements.<a class="self" href="#rfc.section.8.p.3">&para;</a></p></div><div id="rfc.section.8.p.4"><p>Likewise, implementation flaws (as well as misunderstanding of cache operation) might lead to caching of sensitive information (e.g., authentication credentials) that is thought to be private, exposing it to unauthorized parties.<a class="self" href="#rfc.section.8.p.4">&para;</a></p></div><div id="rfc.section.8.p.5"><p>Furthermore, the very use of a cache can bring about privacy concerns. For example, if two users share a cache, and the first one browses to a site, the second may be able to detect that the other has been to that site, because the resources from it load more quickly, thanks to the cache.<a class="self" href="#rfc.section.8.p.5">&para;</a></p></div><div id="rfc.section.8.p.6"><p>Note that the Set-Cookie response header field <a href="#RFC6265" id="rfc.xref.RFC6265.1"><cite title="HTTP State Management Mechanism">[RFC6265]</cite></a> does not inhibit caching; a cacheable response with a Set-Cookie header field can be (and often is) used to satisfy subsequent requests to caches. Servers who wish to control caching of these responses are encouraged to emit appropriate Cache-Control response header fields.<a class="self" href="#rfc.section.8.p.6">&para;</a></p></div></div><div id="acks"><h1 id="rfc.section.9"><a href="#rfc.section.9">9.</a>&nbsp;<a href="#acks">Acknowledgments</a></h1><div id="rfc.section.9.p.1"><p>See <a href="rfc7230.html#acks" title="Acknowledgments">Section 10</a> of <a href="#RFC7230" id="rfc.xref.RFC7230.13"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a>.<a class="self" href="#rfc.section.9.p.1">&para;</a></p></div></div><h1 id="rfc.references"><a id="rfc.section.10" href="#rfc.section.10">10.</a> References</h1><h2 id="rfc.references.1"><a href="#rfc.section.10.1" id="rfc.section.10.1">10.1</a> Normative References</h2><table><tr><td class="reference"><b id="RFC2119">[RFC2119]</b></td><td class="top">Bradner, S., &#8220;<a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>&#8221;, BCP&nbsp;14, RFC&nbsp;2119, March&nbsp;1997.</td></tr><tr><td class="reference"><b id="RFC5234">[RFC5234]</b></td><td class="top">Crocker, D., Ed. and P. Overell, &#8220;<a href="https://tools.ietf.org/html/rfc5234">Augmented BNF for Syntax Specifications: ABNF</a>&#8221;, STD&nbsp;68, RFC&nbsp;5234, January&nbsp;2008.</td></tr><tr><td class="reference"><b id="RFC7230">[RFC7230]</b></td><td class="top">Fielding, R., Ed. and J. Reschke, Ed., &#8220;<a href="https://tools.ietf.org/html/rfc7230">Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</a>&#8221;, RFC&nbsp;7230, June&nbsp;2014.</td></tr><tr><td class="reference"><b id="RFC7231">[RFC7231]</b></td><td class="top">Fielding, R., Ed. and J. Reschke, Ed., &#8220;<a href="https://tools.ietf.org/html/rfc7231">Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</a>&#8221;, RFC&nbsp;7231, June&nbsp;2014.</td></tr><tr><td class="reference"><b id="RFC7232">[RFC7232]</b></td><td class="top">Fielding, R., Ed. and J. Reschke, Ed., &#8220;<a href="https://tools.ietf.org/html/rfc7232">Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests</a>&#8221;, RFC&nbsp;7232, June&nbsp;2014.</td></tr><tr><td class="reference"><b id="RFC7233">[RFC7233]</b></td><td class="top">Fielding, R., Ed., Lafon, Y., Ed., and J. Reschke, Ed., &#8220;<a href="https://tools.ietf.org/html/rfc7233">Hypertext Transfer Protocol (HTTP/1.1): Range Requests</a>&#8221;, RFC&nbsp;7233, June&nbsp;2014.</td></tr><tr><td class="reference"><b id="RFC7235">[RFC7235]</b></td><td class="top">Fielding, R., Ed. and J. Reschke, Ed., &#8220;<a href="https://tools.ietf.org/html/rfc7235">Hypertext Transfer Protocol (HTTP/1.1): Authentication</a>&#8221;, RFC&nbsp;7235, June&nbsp;2014.</td></tr></table><h2 id="rfc.references.2"><a href="#rfc.section.10.2" id="rfc.section.10.2">10.2</a> Informative References</h2><table><tr><td class="reference"><b id="BCP90">[BCP90]</b></td><td class="top">Klyne, G., Nottingham, M., and J. Mogul, &#8220;<a href="https://tools.ietf.org/html/rfc3864">Registration Procedures for Message Header Fields</a>&#8221;, BCP&nbsp;90, RFC&nbsp;3864, September&nbsp;2004.</td></tr><tr><td class="reference"><b id="RFC2616">[RFC2616]</b></td><td class="top">Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, &#8220;<a href="https://tools.ietf.org/html/rfc2616">Hypertext Transfer Protocol -- HTTP/1.1</a>&#8221;, RFC&nbsp;2616, June&nbsp;1999.</td></tr><tr><td class="reference"><b id="RFC5226">[RFC5226]</b></td><td class="top">Narten, T. and H. Alvestrand, &#8220;<a href="https://tools.ietf.org/html/rfc5226">Guidelines for Writing an IANA Considerations Section in RFCs</a>&#8221;, BCP&nbsp;26, RFC&nbsp;5226, May&nbsp;2008.</td></tr><tr><td class="reference"><b id="RFC5861">[RFC5861]</b></td><td class="top">Nottingham, M., &#8220;<a href="https://tools.ietf.org/html/rfc5861">HTTP Cache-Control Extensions for Stale Content</a>&#8221;, RFC&nbsp;5861, April&nbsp;2010.</td></tr><tr><td class="reference"><b id="RFC5905">[RFC5905]</b></td><td class="top">Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch, &#8220;<a href="https://tools.ietf.org/html/rfc5905">Network Time Protocol Version 4: Protocol and Algorithms Specification</a>&#8221;, RFC&nbsp;5905, June&nbsp;2010.</td></tr><tr><td class="reference"><b id="RFC6265">[RFC6265]</b></td><td class="top">Barth, A., &#8220;<a href="https://tools.ietf.org/html/rfc6265">HTTP State Management Mechanism</a>&#8221;, RFC&nbsp;6265, April&nbsp;2011.</td></tr></table><div id="changes.from.rfc.2616"><h1 id="rfc.section.A" class="np"><a href="#rfc.section.A">A.</a>&nbsp;<a href="#changes.from.rfc.2616">Changes from RFC 2616</a></h1><div id="rfc.section.A.p.1"><p>The specification has been substantially rewritten for clarity.<a class="self" href="#rfc.section.A.p.1">&para;</a></p></div><div id="rfc.section.A.p.2"><p>The conditions under which an authenticated response can be cached have been clarified. (<a href="#caching.authenticated.responses" title="Storing Responses to Authenticated Requests">Section&nbsp;3.2</a>)<a class="self" href="#rfc.section.A.p.2">&para;</a></p></div><div id="rfc.section.A.p.3"><p>New status codes can now define that caches are allowed to use heuristic freshness with them. Caches are now allowed to calculate heuristic freshness for URIs with query components. (<a href="#heuristic.freshness" title="Calculating Heuristic Freshness">Section&nbsp;4.2.2</a>)<a class="self" href="#rfc.section.A.p.3">&para;</a></p></div><div id="rfc.section.A.p.4"><p>The algorithm for calculating age is now less conservative. Caches are now required to handle dates with time zones as if they're invalid, because it's not possible to accurately guess. (<a href="#age.calculations" title="Calculating Age">Section&nbsp;4.2.3</a>)<a class="self" href="#rfc.section.A.p.4">&para;</a></p></div><div id="rfc.section.A.p.5"><p>The <a href="rfc7231.html#header.content-location" class="smpl">Content-Location</a> response header field is no longer used to determine the appropriate response to use when validating. (<a href="#validation.model" title="Validation">Section&nbsp;4.3</a>)<a class="self" href="#rfc.section.A.p.5">&para;</a></p></div><div id="rfc.section.A.p.6"><p>The algorithm for selecting a cached negotiated response to use has been clarified in several ways. In particular, it now explicitly allows header-specific canonicalization when processing selecting header fields. (<a href="#caching.negotiated.responses" title="Calculating Secondary Keys with Vary">Section&nbsp;4.1</a>)<a class="self" href="#rfc.section.A.p.6">&para;</a></p></div><div id="rfc.section.A.p.7"><p>Requirements regarding denial-of-service attack avoidance when performing invalidation have been clarified. (<a href="#invalidation" title="Invalidation">Section&nbsp;4.4</a>)<a class="self" href="#rfc.section.A.p.7">&para;</a></p></div><div id="rfc.section.A.p.8"><p>Cache invalidation only occurs when a successful response is received. (<a href="#invalidation" title="Invalidation">Section&nbsp;4.4</a>)<a class="self" href="#rfc.section.A.p.8">&para;</a></p></div><div id="rfc.section.A.p.9"><p>Cache directives are explicitly defined to be case-insensitive. Handling of multiple instances of cache directives when only one is expected is now defined. (<a href="#header.cache-control" id="rfc.xref.header.cache-control.3" title="Cache-Control">Section&nbsp;5.2</a>)<a class="self" href="#rfc.section.A.p.9">&para;</a></p></div><div id="rfc.section.A.p.10"><p>The "no-store" request directive doesn't apply to responses; i.e., a cache can satisfy a request with no-store on it and does not invalidate it. (<a href="#cache-request-directive.no-store" title="no-store">Section&nbsp;5.2.1.5</a>)<a class="self" href="#rfc.section.A.p.10">&para;</a></p></div><div id="rfc.section.A.p.11"><p>The qualified forms of the private and no-cache cache directives are noted to not be widely implemented; for example, "private=foo" is interpreted by many caches as simply "private". Additionally, the meaning of the qualified form of no-cache has been clarified. (<a href="#cache-response-directive" title="Response Cache-Control Directives">Section&nbsp;5.2.2</a>)<a class="self" href="#rfc.section.A.p.11">&para;</a></p></div><div id="rfc.section.A.p.12"><p>The "no-cache" response directive's meaning has been clarified. (<a href="#cache-response-directive.no-cache" title="no-cache">Section&nbsp;5.2.2.2</a>)<a class="self" href="#rfc.section.A.p.12">&para;</a></p></div><div id="rfc.section.A.p.13"><p>The one-year limit on <a href="#header.expires" class="smpl">Expires</a> header field values has been removed; instead, the reasoning for using a sensible value is given. (<a href="#header.expires" id="rfc.xref.header.expires.5" title="Expires">Section&nbsp;5.3</a>)<a class="self" href="#rfc.section.A.p.13">&para;</a></p></div><div id="rfc.section.A.p.14"><p>The <a href="#header.pragma" class="smpl">Pragma</a> header field is now only defined for backwards compatibility; future pragmas are deprecated. (<a href="#header.pragma" id="rfc.xref.header.pragma.3" title="Pragma">Section&nbsp;5.4</a>)<a class="self" href="#rfc.section.A.p.14">&para;</a></p></div><div id="rfc.section.A.p.15"><p>Some requirements regarding production and processing of the <a href="#header.warning" class="smpl">Warning</a> header fields have been relaxed, as it is not widely implemented. Furthermore, the <a href="#header.warning" class="smpl">Warning</a> header field no longer uses RFC 2047 encoding, nor does it allow multiple languages, as these aspects were not implemented. (<a href="#header.warning" id="rfc.xref.header.warning.5" title="Warning">Section&nbsp;5.5</a>)<a class="self" href="#rfc.section.A.p.15">&para;</a></p></div><div id="rfc.section.A.p.16"><p>This specification introduces the Cache Directive and Warn Code Registries, and defines considerations for new cache directives. (<a href="#cache.directive.registry" title="Cache Directive Registry">Section&nbsp;7.1</a> and <a href="#warn.code.registry" title="Warn Code Registry">Section&nbsp;7.2</a>)<a class="self" href="#rfc.section.A.p.16">&para;</a></p></div></div><div id="imported.abnf"><h1 id="rfc.section.B"><a href="#rfc.section.B">B.</a>&nbsp;<a href="#imported.abnf">Imported ABNF</a></h1><div id="rfc.section.B.p.1"><p>The following core rules are included by reference, as defined in <a href="https://tools.ietf.org/html/rfc5234#appendix-B.1">Appendix B.1</a> of <a href="#RFC5234" id="rfc.xref.RFC5234.2"><cite title="Augmented BNF for Syntax Specifications: ABNF">[RFC5234]</cite></a>: ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls), DIGIT (decimal 0-9), DQUOTE (double quote), HEXDIG (hexadecimal 0-9/A-F/a-f), LF (line feed), OCTET (any 8-bit sequence of data), SP (space), and VCHAR (any visible US-ASCII character).<a class="self" href="#rfc.section.B.p.1">&para;</a></p></div><div id="rfc.section.B.p.2"><p>The rules below are defined in <a href="#RFC7230" id="rfc.xref.RFC7230.14"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a>:<a class="self" href="#rfc.section.B.p.2">&para;</a></p></div><div id="rfc.figure.u.15"><pre class="inline">  <a href="#imported.abnf" class="smpl">OWS</a>           = &lt;OWS, see <a href="#RFC7230" id="rfc.xref.RFC7230.15"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a>, <a href="rfc7230.html#whitespace" title="Whitespace">Section 3.2.3</a>&gt;
573  <a href="#imported.abnf" class="smpl">field-name</a>    = &lt;field-name, see <a href="#RFC7230" id="rfc.xref.RFC7230.16"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a>, <a href="rfc7230.html#header.fields" title="Header Fields">Section 3.2</a>&gt;
574  <a href="#imported.abnf" class="smpl">quoted-string</a> = &lt;quoted-string, see <a href="#RFC7230" id="rfc.xref.RFC7230.17"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a>, <a href="rfc7230.html#field.components" title="Field Value Components">Section 3.2.6</a>&gt;
575  <a href="#imported.abnf" class="smpl">token</a>         = &lt;token, see <a href="#RFC7230" id="rfc.xref.RFC7230.18"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a>, <a href="rfc7230.html#field.components" title="Field Value Components">Section 3.2.6</a>&gt;
576
577  <a href="#imported.abnf" class="smpl">port</a>          = &lt;port, see <a href="#RFC7230" id="rfc.xref.RFC7230.19"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a>, <a href="rfc7230.html#uri" title="Uniform Resource Identifiers">Section 2.7</a>&gt;
578  <a href="#imported.abnf" class="smpl">pseudonym</a>     = &lt;pseudonym, see <a href="#RFC7230" id="rfc.xref.RFC7230.20"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a>, <a href="rfc7230.html#header.via" title="Via">Section 5.7.1</a>&gt;
579  <a href="#imported.abnf" class="smpl">uri-host</a>      = &lt;uri-host, see <a href="#RFC7230" id="rfc.xref.RFC7230.21"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a>, <a href="rfc7230.html#uri" title="Uniform Resource Identifiers">Section 2.7</a>&gt;
580</pre></div><div id="rfc.section.B.p.3"><p>The rules below are defined in other parts:<a class="self" href="#rfc.section.B.p.3">&para;</a></p></div><div id="rfc.figure.u.16"><pre class="inline">  <a href="#imported.abnf" class="smpl">HTTP-date</a>     = &lt;HTTP-date, see <a href="#RFC7231" id="rfc.xref.RFC7231.10"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[RFC7231]</cite></a>, <a href="rfc7231.html#http.date" title="Date/Time Formats">Section 7.1.1.1</a>&gt;
581</pre></div></div><div id="collected.abnf"><h1 id="rfc.section.C"><a href="#rfc.section.C">C.</a>&nbsp;<a href="#collected.abnf">Collected ABNF</a></h1><div id="rfc.section.C.p.1"><p>In the collected ABNF below, list rules are expanded as per <a href="rfc7230.html#notation" title="Syntax Notation">Section 1.2</a> of <a href="#RFC7230" id="rfc.xref.RFC7230.22"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[RFC7230]</cite></a>.<a class="self" href="#rfc.section.C.p.1">&para;</a></p></div><div id="rfc.figure.u.17"><pre class="inline"><a href="#header.age" class="smpl">Age</a> = delta-seconds
582
583<a href="#header.cache-control" class="smpl">Cache-Control</a> = *( "," OWS ) cache-directive *( OWS "," [ OWS
584 cache-directive ] )
585
586<a href="#header.expires" class="smpl">Expires</a> = HTTP-date
587
588<a href="#imported.abnf" class="smpl">HTTP-date</a> = &lt;HTTP-date, see [RFC7231], Section 7.1.1.1&gt;
589
590<a href="#imported.abnf" class="smpl">OWS</a> = &lt;OWS, see [RFC7230], Section 3.2.3&gt;
591
592<a href="#header.pragma" class="smpl">Pragma</a> = *( "," OWS ) pragma-directive *( OWS "," [ OWS
593 pragma-directive ] )
594
595<a href="#header.warning" class="smpl">Warning</a> = *( "," OWS ) warning-value *( OWS "," [ OWS warning-value ]
596 )
597
598<a href="#header.cache-control" class="smpl">cache-directive</a> = token [ "=" ( token / quoted-string ) ]
599
600<a href="#delta-seconds" class="smpl">delta-seconds</a> = 1*DIGIT
601
602<a href="#header.pragma" class="smpl">extension-pragma</a> = token [ "=" ( token / quoted-string ) ]
603
604<a href="#imported.abnf" class="smpl">field-name</a> = &lt;field-name, see [RFC7230], Section 3.2&gt;
605
606<a href="#imported.abnf" class="smpl">port</a> = &lt;port, see [RFC7230], Section 2.7&gt;
607<a href="#header.pragma" class="smpl">pragma-directive</a> = "no-cache" / extension-pragma
608<a href="#imported.abnf" class="smpl">pseudonym</a> = &lt;pseudonym, see [RFC7230], Section 5.7.1&gt;
609
610<a href="#imported.abnf" class="smpl">quoted-string</a> = &lt;quoted-string, see [RFC7230], Section 3.2.6&gt;
611
612<a href="#imported.abnf" class="smpl">token</a> = &lt;token, see [RFC7230], Section 3.2.6&gt;
613
614<a href="#imported.abnf" class="smpl">uri-host</a> = &lt;uri-host, see [RFC7230], Section 2.7&gt;
615
616<a href="#header.warning" class="smpl">warn-agent</a> = ( uri-host [ ":" port ] ) / pseudonym
617<a href="#header.warning" class="smpl">warn-code</a> = 3DIGIT
618<a href="#header.warning" class="smpl">warn-date</a> = DQUOTE HTTP-date DQUOTE
619<a href="#header.warning" class="smpl">warn-text</a> = quoted-string
620<a href="#header.warning" class="smpl">warning-value</a> = warn-code SP warn-agent SP warn-text [ SP warn-date
621 ]
622</pre></div></div><h1 id="rfc.index"><a href="#rfc.index">Index</a></h1><p class="noprint"><a href="#rfc.index.1">1</a> <a href="#rfc.index.2">2</a> <a href="#rfc.index.A">A</a> <a href="#rfc.index.B">B</a> <a href="#rfc.index.C">C</a> <a href="#rfc.index.D">D</a> <a href="#rfc.index.E">E</a> <a href="#rfc.index.F">F</a> <a href="#rfc.index.G">G</a> <a href="#rfc.index.H">H</a> <a href="#rfc.index.M">M</a> <a href="#rfc.index.N">N</a> <a href="#rfc.index.O">O</a> <a href="#rfc.index.P">P</a> <a href="#rfc.index.R">R</a> <a href="#rfc.index.S">S</a> <a href="#rfc.index.T">T</a> <a href="#rfc.index.V">V</a> <a href="#rfc.index.W">W</a> </p><div class="print2col"><ul class="ind"><li><a id="rfc.index.1" href="#rfc.index.1"><b>1</b></a><ul><li>110 (warn-code)&nbsp;&nbsp;<a href="#rfc.xref.warn.110.1">4.2.4</a>, <a href="#rfc.section.5.5.1"><b>5.5.1</b></a>, <a href="#rfc.xref.warn.110.2">7.2.2</a></li><li>111 (warn-code)&nbsp;&nbsp;<a href="#rfc.section.5.5.2"><b>5.5.2</b></a>, <a href="#rfc.xref.warn.111.1">7.2.2</a></li><li>112 (warn-code)&nbsp;&nbsp;<a href="#rfc.xref.warn.112.1">4.2.4</a>, <a href="#rfc.section.5.5.3"><b>5.5.3</b></a>, <a href="#rfc.xref.warn.112.2">7.2.2</a></li><li>113 (warn-code)&nbsp;&nbsp;<a href="#rfc.xref.warn.113.1">4.2.2</a>, <a href="#rfc.section.5.5.4"><b>5.5.4</b></a>, <a href="#rfc.xref.warn.113.2">7.2.2</a></li><li>199 (warn-code)&nbsp;&nbsp;<a href="#rfc.section.5.5.5"><b>5.5.5</b></a>, <a href="#rfc.xref.warn.199.1">7.2.2</a></li></ul></li><li><a id="rfc.index.2" href="#rfc.index.2"><b>2</b></a><ul><li>214 (warn-code)&nbsp;&nbsp;<a href="#rfc.section.5.5.6"><b>5.5.6</b></a>, <a href="#rfc.xref.warn.214.1">7.2.2</a></li><li>299 (warn-code)&nbsp;&nbsp;<a href="#rfc.section.5.5.7"><b>5.5.7</b></a>, <a href="#rfc.xref.warn.299.1">7.2.2</a></li></ul></li><li><a id="rfc.index.A" href="#rfc.index.A"><b>A</b></a><ul><li>age&nbsp;&nbsp;<a href="#rfc.iref.a.1">4.2</a></li><li>Age header field&nbsp;&nbsp;<a href="#rfc.xref.header.age.1">4</a>, <a href="#rfc.xref.header.age.2">4.2.3</a>, <a href="#rfc.section.5.1"><b>5.1</b></a>, <a href="#rfc.xref.header.age.3">7.3</a></li></ul></li><li><a id="rfc.index.B" href="#rfc.index.B"><b>B</b></a><ul><li><em>BCP90</em>&nbsp;&nbsp;<a href="#rfc.xref.BCP90.1">7.3</a>, <a href="#BCP90"><b>10.2</b></a></li></ul></li><li><a id="rfc.index.C" href="#rfc.index.C"><b>C</b></a><ul><li>cache&nbsp;&nbsp;<a href="#rfc.iref.c.1">1</a></li><li>cache entry&nbsp;&nbsp;<a href="#rfc.section.2">2</a></li><li>cache key&nbsp;&nbsp;<a href="#rfc.section.2">2</a>, <a href="#rfc.iref.c.2">2</a></li><li>Cache-Control header field&nbsp;&nbsp;<a href="#rfc.xref.header.cache-control.1">3</a>, <a href="#rfc.section.5.2"><b>5.2</b></a>, <a href="#rfc.xref.header.cache-control.2">7.3</a>, <a href="#rfc.xref.header.cache-control.3">A</a></li></ul></li><li><a id="rfc.index.D" href="#rfc.index.D"><b>D</b></a><ul><li>Disconnected Operation (warn-text)&nbsp;&nbsp;<a href="#rfc.xref.warn.112.1">4.2.4</a>, <a href="#rfc.section.5.5.3"><b>5.5.3</b></a>, <a href="#rfc.xref.warn.112.2">7.2.2</a></li></ul></li><li><a id="rfc.index.E" href="#rfc.index.E"><b>E</b></a><ul><li>Expires header field&nbsp;&nbsp;<a href="#rfc.xref.header.expires.1">3</a>, <a href="#rfc.xref.header.expires.2">4.2</a>, <a href="#rfc.xref.header.expires.3">4.2.1</a>, <a href="#rfc.section.5.3"><b>5.3</b></a>, <a href="#rfc.xref.header.expires.4">7.3</a>, <a href="#rfc.xref.header.expires.5">A</a></li><li>explicit expiration time&nbsp;&nbsp;<a href="#rfc.iref.e.1">4.2</a></li></ul></li><li><a id="rfc.index.F" href="#rfc.index.F"><b>F</b></a><ul><li>fresh&nbsp;&nbsp;<a href="#rfc.section.4.2">4.2</a></li><li>freshness lifetime&nbsp;&nbsp;<a href="#rfc.iref.f.1">4.2</a></li></ul></li><li><a id="rfc.index.G" href="#rfc.index.G"><b>G</b></a><ul><li><tt>Grammar</tt>&nbsp;&nbsp;<ul><li><tt>Age</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.2"><b>5.1</b></a></li><li><tt>Cache-Control</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.3"><b>5.2</b></a></li><li><tt>cache-directive</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.4"><b>5.2</b></a></li><li><tt>delta-seconds</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.1"><b>1.2.1</b></a></li><li><tt>Expires</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.5"><b>5.3</b></a></li><li><tt>extension-pragma</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.8"><b>5.4</b></a></li><li><tt>Pragma</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.6"><b>5.4</b></a></li><li><tt>pragma-directive</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.7"><b>5.4</b></a></li><li><tt>warn-agent</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.12"><b>5.5</b></a></li><li><tt>warn-code</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.11"><b>5.5</b></a></li><li><tt>warn-date</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.14"><b>5.5</b></a></li><li><tt>warn-text</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.13"><b>5.5</b></a></li><li><tt>Warning</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.9"><b>5.5</b></a></li><li><tt>warning-value</tt>&nbsp;&nbsp;<a href="#rfc.iref.g.10"><b>5.5</b></a></li></ul></li></ul></li><li><a id="rfc.index.H" href="#rfc.index.H"><b>H</b></a><ul><li>Heuristic Expiration (warn-text)&nbsp;&nbsp;<a href="#rfc.xref.warn.113.1">4.2.2</a>, <a href="#rfc.section.5.5.4"><b>5.5.4</b></a>, <a href="#rfc.xref.warn.113.2">7.2.2</a></li><li>heuristic expiration time&nbsp;&nbsp;<a href="#rfc.iref.h.1">4.2</a></li></ul></li><li><a id="rfc.index.M" href="#rfc.index.M"><b>M</b></a><ul><li>max-age (cache directive)&nbsp;&nbsp;<a href="#rfc.section.5.2.1.1"><b>5.2.1.1</b></a>, <a href="#rfc.section.5.2.2.8"><b>5.2.2.8</b></a></li><li>max-stale (cache directive)&nbsp;&nbsp;<a href="#rfc.section.5.2.1.2"><b>5.2.1.2</b></a></li><li>min-fresh (cache directive)&nbsp;&nbsp;<a href="#rfc.section.5.2.1.3"><b>5.2.1.3</b></a></li><li>Miscellaneous Persistent Warning (warn-text)&nbsp;&nbsp;<a href="#rfc.section.5.5.7"><b>5.5.7</b></a>, <a href="#rfc.xref.warn.299.1">7.2.2</a></li><li>Miscellaneous Warning (warn-text)&nbsp;&nbsp;<a href="#rfc.section.5.5.5"><b>5.5.5</b></a>, <a href="#rfc.xref.warn.199.1">7.2.2</a></li><li>must-revalidate (cache directive)&nbsp;&nbsp;<a href="#rfc.section.5.2.2.1"><b>5.2.2.1</b></a></li></ul></li><li><a id="rfc.index.N" href="#rfc.index.N"><b>N</b></a><ul><li>no-cache (cache directive)&nbsp;&nbsp;<a href="#rfc.section.5.2.1.4"><b>5.2.1.4</b></a>, <a href="#rfc.section.5.2.2.2"><b>5.2.2.2</b></a></li><li>no-store (cache directive)&nbsp;&nbsp;<a href="#rfc.section.5.2.1.5"><b>5.2.1.5</b></a>, <a href="#rfc.section.5.2.2.3"><b>5.2.2.3</b></a></li><li>no-transform (cache directive)&nbsp;&nbsp;<a href="#rfc.section.5.2.1.6"><b>5.2.1.6</b></a>, <a href="#rfc.section.5.2.2.4"><b>5.2.2.4</b></a></li></ul></li><li><a id="rfc.index.O" href="#rfc.index.O"><b>O</b></a><ul><li>only-if-cached (cache directive)&nbsp;&nbsp;<a href="#rfc.section.5.2.1.7"><b>5.2.1.7</b></a></li></ul></li><li><a id="rfc.index.P" href="#rfc.index.P"><b>P</b></a><ul><li>Pragma header field&nbsp;&nbsp;<a href="#rfc.xref.header.pragma.1">4</a>, <a href="#rfc.section.5.4"><b>5.4</b></a>, <a href="#rfc.xref.header.pragma.2">7.3</a>, <a href="#rfc.xref.header.pragma.3">A</a></li><li>private (cache directive)&nbsp;&nbsp;<a href="#rfc.section.5.2.2.6"><b>5.2.2.6</b></a></li><li>private cache&nbsp;&nbsp;<a href="#rfc.iref.p.1">1</a></li><li>proxy-revalidate (cache directive)&nbsp;&nbsp;<a href="#rfc.section.5.2.2.7"><b>5.2.2.7</b></a></li><li>public (cache directive)&nbsp;&nbsp;<a href="#rfc.section.5.2.2.5"><b>5.2.2.5</b></a></li></ul></li><li><a id="rfc.index.R" href="#rfc.index.R"><b>R</b></a><ul><li>Response is Stale (warn-text)&nbsp;&nbsp;<a href="#rfc.xref.warn.110.1">4.2.4</a>, <a href="#rfc.section.5.5.1"><b>5.5.1</b></a>, <a href="#rfc.xref.warn.110.2">7.2.2</a></li><li>Revalidation Failed (warn-text)&nbsp;&nbsp;<a href="#rfc.section.5.5.2"><b>5.5.2</b></a>, <a href="#rfc.xref.warn.111.1">7.2.2</a></li><li><em>RFC2119</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC2119.1">1.1</a>, <a href="#RFC2119"><b>10.1</b></a></li><li><em>RFC2616</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC2616.1">4.2.2</a>, <a href="#RFC2616"><b>10.2</b></a><ul><li><em>Section 13.9</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC2616.1">4.2.2</a></li></ul></li><li><em>RFC5226</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC5226.1">7.1.1</a>, <a href="#rfc.xref.RFC5226.2">7.2.1</a>, <a href="#RFC5226"><b>10.2</b></a><ul><li><em>Section 4.1</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC5226.1">7.1.1</a>, <a href="#rfc.xref.RFC5226.2">7.2.1</a></li></ul></li><li><em>RFC5234</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC5234.1">1.2</a>, <a href="#RFC5234"><b>10.1</b></a>, <a href="#rfc.xref.RFC5234.2">B</a><ul><li><em>Appendix B.1</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC5234.2">B</a></li></ul></li><li><em>RFC5861</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC5861.1">7.1.3</a>, <a href="#rfc.xref.RFC5861.2">7.1.3</a>, <a href="#RFC5861"><b>10.2</b></a><ul><li><em>Section 3</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC5861.2">7.1.3</a></li><li><em>Section 4</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC5861.1">7.1.3</a></li></ul></li><li><em>RFC5905</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC5905.1">4.2.3</a>, <a href="#RFC5905"><b>10.2</b></a></li><li><em>RFC6265</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC6265.1">8</a>, <a href="#RFC6265"><b>10.2</b></a></li><li><em>RFC7230</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7230.1">1.1</a>, <a href="#rfc.xref.RFC7230.2">1.2</a>, <a href="#rfc.xref.RFC7230.3">3.1</a>, <a href="#rfc.xref.RFC7230.4">4</a>, <a href="#rfc.xref.RFC7230.5">4.1</a>, <a href="#rfc.xref.RFC7230.6">4.4</a>, <a href="#rfc.xref.RFC7230.7">4.4</a>, <a href="#rfc.xref.RFC7230.8">4.4</a>, <a href="#rfc.xref.RFC7230.9">5.2.1.6</a>, <a href="#rfc.xref.RFC7230.10">5.2.2.4</a>, <a href="#rfc.xref.RFC7230.11">8</a>, <a href="#rfc.xref.RFC7230.12">8</a>, <a href="#rfc.xref.RFC7230.13">9</a>, <a href="#RFC7230"><b>10.1</b></a>, <a href="#rfc.xref.RFC7230.14">B</a>, <a href="#rfc.xref.RFC7230.15">B</a>, <a href="#rfc.xref.RFC7230.16">B</a>, <a href="#rfc.xref.RFC7230.17">B</a>, <a href="#rfc.xref.RFC7230.18">B</a>, <a href="#rfc.xref.RFC7230.19">B</a>, <a href="#rfc.xref.RFC7230.20">B</a>, <a href="#rfc.xref.RFC7230.21">B</a>, <a href="#rfc.xref.RFC7230.22">C</a><ul><li><em>Section 1.2</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7230.22">C</a></li><li><em>Section 2.5</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7230.1">1.1</a></li><li><em>Section 2.7</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7230.19">B</a>, <a href="#rfc.xref.RFC7230.21">B</a></li><li><em>Section 3.2</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7230.5">4.1</a>, <a href="#rfc.xref.RFC7230.16">B</a></li><li><em>Section 3.2.3</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7230.15">B</a></li><li><em>Section 3.2.6</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7230.17">B</a>, <a href="#rfc.xref.RFC7230.18">B</a></li><li><em>Section 3.3.3</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7230.12">8</a></li><li><em>Section 5.5</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7230.4">4</a>, <a href="#rfc.xref.RFC7230.6">4.4</a>, <a href="#rfc.xref.RFC7230.7">4.4</a>, <a href="#rfc.xref.RFC7230.8">4.4</a></li><li><em>Section 5.7.1</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7230.20">B</a></li><li><em>Section 5.7.2</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7230.9">5.2.1.6</a>, <a href="#rfc.xref.RFC7230.10">5.2.2.4</a></li><li><em>Section 7</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7230.2">1.2</a></li><li><em>Section 10</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7230.13">9</a></li></ul></li><li><em>RFC7231</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7231.1">2</a>, <a href="#rfc.xref.RFC7231.2">2</a>, <a href="#rfc.xref.RFC7231.3">4</a>, <a href="#rfc.xref.RFC7231.4">4.1</a>, <a href="#rfc.xref.RFC7231.5">4.2.2</a>, <a href="#rfc.xref.RFC7231.6">4.2.3</a>, <a href="#rfc.xref.RFC7231.7">4.4</a>, <a href="#rfc.xref.RFC7231.8">5.3</a>, <a href="#rfc.xref.RFC7231.9">8</a>, <a href="#RFC7231"><b>10.1</b></a>, <a href="#rfc.xref.RFC7231.10">B</a><ul><li><em>Section 4.2.1</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7231.3">4</a>, <a href="#rfc.xref.RFC7231.7">4.4</a></li><li><em>Section 4.3.1</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7231.2">2</a></li><li><em>Section 6.1</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7231.5">4.2.2</a></li><li><em>Section 7.1.1.1</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7231.8">5.3</a>, <a href="#rfc.xref.RFC7231.10">B</a></li><li><em>Section 7.1.1.2</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7231.6">4.2.3</a></li><li><em>Section 7.1.4</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7231.4">4.1</a></li></ul></li><li><em>RFC7232</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7232.1">4.2.2</a>, <a href="#rfc.xref.RFC7232.2">4.3</a>, <a href="#rfc.xref.RFC7232.3">4.3.1</a>, <a href="#rfc.xref.RFC7232.4">4.3.1</a>, <a href="#rfc.xref.RFC7232.5">4.3.2</a>, <a href="#rfc.xref.RFC7232.6">4.3.2</a>, <a href="#rfc.xref.RFC7232.7">4.3.2</a>, <a href="#rfc.xref.RFC7232.8">4.3.4</a>, <a href="#RFC7232"><b>10.1</b></a><ul><li><em>Section 2.1</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7232.8">4.3.4</a></li><li><em>Section 2.2</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7232.1">4.2.2</a>, <a href="#rfc.xref.RFC7232.3">4.3.1</a></li><li><em>Section 2.3</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7232.4">4.3.1</a></li><li><em>Section 3.2</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7232.6">4.3.2</a></li><li><em>Section 3.3</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7232.7">4.3.2</a></li><li><em>Section 6</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7232.5">4.3.2</a></li></ul></li><li><em>RFC7233</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7233.1">3.1</a>, <a href="#rfc.xref.RFC7233.2">3.3</a>, <a href="#rfc.xref.RFC7233.3">3.3</a>, <a href="#rfc.xref.RFC7233.4">4.3.2</a>, <a href="#rfc.xref.RFC7233.5">4.3.2</a>, <a href="#RFC7233"><b>10.1</b></a><ul><li><em>Section 3.2</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7233.5">4.3.2</a></li><li><em>Section 4.3</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7233.3">3.3</a></li></ul></li><li><em>RFC7235</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7235.1">3</a>, <a href="#rfc.xref.RFC7235.2">3.2</a>, <a href="#RFC7235"><b>10.1</b></a><ul><li><em>Section 4.2</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC7235.1">3</a>, <a href="#rfc.xref.RFC7235.2">3.2</a></li></ul></li></ul></li><li><a id="rfc.index.S" href="#rfc.index.S"><b>S</b></a><ul><li>s-maxage (cache directive)&nbsp;&nbsp;<a href="#rfc.section.5.2.2.9"><b>5.2.2.9</b></a></li><li>shared cache&nbsp;&nbsp;<a href="#rfc.iref.s.1">1</a></li><li>stale&nbsp;&nbsp;<a href="#rfc.section.4.2">4.2</a></li><li>strong validator&nbsp;&nbsp;<a href="#rfc.iref.s.2">4.3.4</a></li></ul></li><li><a id="rfc.index.T" href="#rfc.index.T"><b>T</b></a><ul><li>Transformation Applied (warn-text)&nbsp;&nbsp;<a href="#rfc.section.5.5.6"><b>5.5.6</b></a>, <a href="#rfc.xref.warn.214.1">7.2.2</a></li></ul></li><li><a id="rfc.index.V" href="#rfc.index.V"><b>V</b></a><ul><li>validator&nbsp;&nbsp;<a href="#rfc.section.4.3.1">4.3.1</a></li></ul></li><li><a id="rfc.index.W" href="#rfc.index.W"><b>W</b></a><ul><li>Warning header field&nbsp;&nbsp;<a href="#rfc.xref.header.warning.1">3.3</a>, <a href="#rfc.xref.header.warning.2">4.3.4</a>, <a href="#rfc.xref.header.warning.3">4.3.5</a>, <a href="#rfc.section.5.5"><b>5.5</b></a>, <a href="#rfc.xref.header.warning.4">7.3</a>, <a href="#rfc.xref.header.warning.5">A</a></li></ul></li></ul></div><div class="avoidbreakinside"><h1 id="rfc.authors"><a href="#rfc.authors">Authors' Addresses</a></h1><p><b>Roy T. Fielding</b>
623      (editor)
624    <br>Adobe Systems Incorporated<br>345 Park Ave<br>San Jose, CA&nbsp;95110<br>USA<br>Email: fielding@gbiv.com<br>URI: <a href="http://roy.gbiv.com/">http://roy.gbiv.com/</a></p><p><b>Mark Nottingham</b>
625      (editor)
626    <br>Akamai<br>Email: mnot@mnot.net<br>URI: <a href="http://www.mnot.net/">http://www.mnot.net/</a></p><p><b>Julian F. Reschke</b>
627      (editor)
628    <br>greenbytes GmbH<br>Hafenweg 16<br>Muenster, NW&nbsp;48155<br>Germany<br>Email: julian.reschke@greenbytes.de<br>URI: <a href="http://greenbytes.de/tech/webdav/">http://greenbytes.de/tech/webdav/</a></p></div></body></html>
Note: See TracBrowser for help on using the repository browser.