You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@labs.apache.org by fi...@apache.org on 2007/10/09 02:43:05 UTC

svn commit: r583027 - /labs/webarch/trunk/http/draft-fielding-http/p6-cache.html

Author: fielding
Date: Mon Oct  8 17:43:04 2007
New Revision: 583027

URL: http://svn.apache.org/viewvc?rev=583027&view=rev
Log:
HTTP/1.1, part 6: Caching

Added:
    labs/webarch/trunk/http/draft-fielding-http/p6-cache.html   (with props)

Added: labs/webarch/trunk/http/draft-fielding-http/p6-cache.html
URL: http://svn.apache.org/viewvc/labs/webarch/trunk/http/draft-fielding-http/p6-cache.html?rev=583027&view=auto
==============================================================================
--- labs/webarch/trunk/http/draft-fielding-http/p6-cache.html (added)
+++ labs/webarch/trunk/http/draft-fielding-http/p6-cache.html Mon Oct  8 17:43:04 2007
@@ -0,0 +1,410 @@
+<!DOCTYPE html
+  PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<html lang="en"><head profile="http://www.w3.org/2006/03/hcard"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>HTTP/1.1, part 6: Caching</title><style type="text/css" title="Xml2Rfc (sans serif)">
+a {
+  text-decoration: none;
+}
+a.smpl {
+  color: black;
+}
+a:hover {
+  text-decoration: underline;
+}
+a:active {
+  text-decoration: underline;
+}
+address {
+  margin-top: 1em;
+  margin-left: 2em;
+  font-style: normal;
+}
+body {
+  color: black;
+  font-family: verdana, helvetica, arial, sans-serif;
+  font-size: 10pt;
+}
+cite {
+  font-style: normal;
+}
+dd {
+  margin-right: 2em;
+}
+dl {
+  margin-left: 2em;
+}
+
+dl.empty dd {
+  margin-top: .5em;
+}
+dl p {
+  margin-left: 0em;
+}
+dt {
+  margin-top: .5em;
+}
+h1 {
+  font-size: 14pt;
+  line-height: 21pt;
+  page-break-after: avoid;
+}
+h1.np {
+  page-break-before: always;
+}
+h1 a {
+  color: #333333;
+}
+h2 {
+  font-size: 12pt;
+  line-height: 15pt;
+  page-break-after: avoid;
+}
+h2 a {
+  color: black;
+}
+h3 {
+  font-size: 10pt;
+  page-break-after: avoid;
+}
+h3 a {
+  color: black;
+}
+h4 {
+  font-size: 10pt;
+  page-break-after: avoid;
+}
+h4 a {
+  color: black;
+}
+h5 {
+  font-size: 10pt;
+  page-break-after: avoid;
+}
+h5 a {
+  color: black;
+}
+img {
+  margin-left: 3em;
+}
+li {
+  margin-left: 2em;
+  margin-right: 2em;
+}
+ol {
+  margin-left: 2em;
+  margin-right: 2em;
+}
+ol p {
+  margin-left: 0em;
+}
+p {
+  margin-left: 2em;
+  margin-right: 2em;
+}
+pre {
+  margin-left: 3em;
+  background-color: lightyellow;
+  padding: .25em;
+}
+pre.text2 {
+  border-style: dotted;
+  border-width: 1px;
+  background-color: #f0f0f0;
+  width: 69em;
+}
+pre.inline {
+  background-color: white;
+  padding: 0em;
+}
+pre.text {
+  border-style: dotted;
+  border-width: 1px;
+  background-color: #f8f8f8;
+  width: 69em;
+}
+pre.drawing {
+  border-style: solid;
+  border-width: 1px;
+  background-color: #f8f8f8;
+  padding: 2em;
+}
+table {
+  margin-left: 2em;
+}
+table.header {
+  width: 95%;
+  font-size: 10pt;
+  color: white;
+}
+td.top {
+  vertical-align: top;
+}
+td.topnowrap {
+  vertical-align: top;
+  white-space: nowrap; 
+}
+td.header {
+  background-color: gray;
+  width: 50%;
+}
+td.reference {
+  vertical-align: top;
+  white-space: nowrap;
+  padding-right: 1em;
+}
+thead {
+  display:table-header-group;
+}
+ul.toc {
+  list-style: none;
+  margin-left: 1.5em;
+  margin-right: 0em;
+  padding-left: 0em;
+}
+li.tocline0 {
+  line-height: 150%;
+  font-weight: bold;
+  font-size: 10pt;
+  margin-left: 0em;
+  margin-right: 0em;
+}
+li.tocline1 {
+  line-height: normal;
+  font-weight: normal;
+  font-size: 9pt;
+  margin-left: 0em;
+  margin-right: 0em;
+}
+li.tocline2 {
+  font-size: 0pt;
+}
+ul p {
+  margin-left: 0em;
+}
+ul.ind {
+  list-style: none;
+  margin-left: 1.5em;
+  margin-right: 0em;
+  padding-left: 0em;
+}
+li.indline0 {
+  font-weight: bold;
+  line-height: 200%;
+  margin-left: 0em;
+  margin-right: 0em;
+}
+li.indline1 {
+  font-weight: normal;
+  line-height: 150%;
+  margin-left: 0em;
+  margin-right: 0em;
+}
+.bcp14 {
+  font-style: normal;
+  text-transform: lowercase;
+  font-variant: small-caps;
+}
+.comment {
+  background-color: yellow;
+}
+.center {
+  text-align: center;
+}
+.error {
+  color: red;
+  font-style: italic;
+  font-weight: bold;
+}
+.figure {
+  font-weight: bold;
+  text-align: center;
+  font-size: 9pt;
+}
+.filename {
+  color: #333333;
+  font-weight: bold;
+  font-size: 12pt;
+  line-height: 21pt;
+  text-align: center;
+}
+.fn {
+  font-weight: bold;
+}
+.hidden {
+  display: none;
+}
+.left {
+  text-align: left;
+}
+.right {
+  text-align: right;
+}
+.title {
+  color: #990000;
+  font-size: 18pt;
+  line-height: 18pt;
+  font-weight: bold;
+  text-align: center;
+  margin-top: 36pt;
+}
+.vcardline {
+  display: block;
+}
+.warning {
+  font-size: 14pt;
+  background-color: yellow;
+}
+
+
+@media print {
+  .noprint {
+    display: none;
+  }
+  
+  a {
+    color: black;
+    text-decoration: none;
+  }
+
+  table.header {
+    width: 90%;
+  }
+
+  td.header {
+    width: 50%;
+    color: black;
+    background-color: white;
+    vertical-align: top;
+    font-size: 12pt;
+  }
+
+  ul.toc a::after {
+    content: leader('.') target-counter(attr(href), page);
+  }
+  
+  a.iref {
+    content: target-counter(attr(href), page);
+  }
+  
+  .print2col {
+    column-count: 2;
+    -moz-column-count: 2;
+    column-fill: auto;
+  }
+}
+
+@page {
+  @top-left {
+       content: "INTERNET DRAFT"; 
+  } 
+  @top-right {
+       content: "September 2007"; 
+  } 
+  @top-center {
+       content: "HTTP/1.1, part 6"; 
+  } 
+  @bottom-left {
+       content: "Fielding, et al."; 
+  } 
+  @bottom-center {
+       content: "Standards Track"; 
+  } 
+  @bottom-right {
+       content: "[Page " counter(page) "]"; 
+  } 
+}
+
+@page:first { 
+    @top-left {
+      content: normal;
+    }
+    @top-right {
+      content: normal;
+    }
+    @top-center {
+      content: normal;
+    }
+}
+</style><link rel="Contents" href="#rfc.toc"><link rel="Author" href="#rfc.authors"><link rel="Copyright" href="#rfc.copyright"><link rel="Index" href="#rfc.index"><link rel="Chapter" title="1 Introduction" href="#rfc.section.1"><link rel="Chapter" title="2 Caching in HTTP" href="#rfc.section.2"><link rel="Chapter" title="3 Header Field Definitions" href="#rfc.section.3"><link rel="Chapter" title="4 Security Considerations" href="#rfc.section.4"><link rel="Chapter" title="5 Acknowledgments" href="#rfc.section.5"><link rel="Chapter" href="#rfc.section.6" title="6 References"><link rel="Appendix" title="A Changes from RFC 2068" href="#rfc.section.A"><meta name="generator" content="http://greenbytes.de/tech/webdav/rfc2629.xslt, Revision 1.346, 2007/10/07 13:54:24, XSLT vendor: SAXON 8.5.1 from Saxonica http://www.saxonica.com/"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.Creator" content="Fielding, R."><meta name="DC.Creator" content="Gettys, J.
 "><meta name="DC.Creator" content="Mogul, J."><meta name="DC.Creator" content="Frystyk, H."><meta name="DC.Creator" content="Masinter, L."><meta name="DC.Creator" content="Leach, P."><meta name="DC.Creator" content="Berners-Lee, T."><meta name="DC.Identifier" content="urn:ietf:id:draft-fielding-http-p6-cache-00"><meta name="DC.Date.Issued" scheme="ISO8601" content="2007-09"><meta name="DC.Relation.Replaces" content="urn:ietf:rfc:2068"><meta name="DC.Relation.Replaces" content="urn:ietf:rfc:2616"><meta name="DC.Relation.Replaces" content="urn:ietf:rfc:2617"><meta name="DC.Description.Abstract" content="The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. HTTP has been in use by the World Wide Web global information initiative since 1990. This document is Part 6 of the eight-part specification that defines the protocol referred to as &#34;HTTP/1.1&#34; and, taken together, updates RFC 2616 and R
 FC 2617. Part 4 defines requirements on HTTP caches and the associated header fields that control cache behavior or indicate cacheable response messages."></head><body><table summary="header information" class="header" border="0" cellpadding="1" cellspacing="1"><tr><td class="header left">Network Working Group</td><td class="header right">R. Fielding</td></tr><tr><td class="header left">Internet Draft</td><td class="header right">UC Irvine</td></tr><tr><td class="header left">
+        &lt;draft-fielding-http-p6-cache-00&gt;
+      </td><td class="header right">J. Gettys</td></tr><tr><td class="header left">Obsoletes: <a href="http://tools.ietf.org/html/rfc2068">2068</a>,
+      <a href="http://tools.ietf.org/html/rfc2616">2616</a>,
+      <a href="http://tools.ietf.org/html/rfc2617">2617</a> (if approved)</td><td class="header right">Compaq/W3C</td></tr><tr><td class="header left">Intended status: Standards Track</td><td class="header right">J. Mogul</td></tr><tr><td class="header left">Expires: March 2008</td><td class="header right">Compaq</td></tr><tr><td class="header left"></td><td class="header right">H. Frystyk</td></tr><tr><td class="header left"></td><td class="header right">W3C/MIT</td></tr><tr><td class="header left"></td><td class="header right">L. Masinter</td></tr><tr><td class="header left"></td><td class="header right">Xerox</td></tr><tr><td class="header left"></td><td class="header right">P. Leach</td></tr><tr><td class="header left"></td><td class="header right">Microsoft</td></tr><tr><td class="header left"></td><td class="header right">T. Berners-Lee</td></tr><tr><td class="header left"></td><td class="header right">W3C/MIT</td></tr><tr><td class="header left"></td><td class="header
  right">September 2007</td></tr></table><p class="title">HTTP/1.1, part 6: Caching<br><span class="filename">draft-fielding-http-p6-cache-00</span></p><h1><a id="rfc.status" href="#rfc.status">Status of this Memo</a></h1><p>This document is an Internet-Draft and is subject to all provisions of section 3 of RFC 3667. By submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she is aware have been or will be disclosed, and any of which he or she become aware will be disclosed, in accordance with RFC 3668.</p><p>Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts.</p><p>Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference mate
 rial or to cite them other than as &#8220;work in progress&#8221;.</p><p>The list of current Internet-Drafts can be accessed at &lt;<a href="http://www.ietf.org/ietf/1id-abstracts.txt">http://www.ietf.org/ietf/1id-abstracts.txt</a>&gt;.</p><p>The list of Internet-Draft Shadow Directories can be accessed at &lt;<a href="http://www.ietf.org/shadow.html">http://www.ietf.org/shadow.html</a>&gt;.</p><p>This Internet-Draft will expire in March 2008.</p><h1><a id="rfc.copyrightnotice" href="#rfc.copyrightnotice">Copyright Notice</a></h1><p>Copyright © The IETF Trust (2007). All Rights Reserved.</p><h1 id="rfc.abstract"><a href="#rfc.abstract">Abstract</a></h1> <p>The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. HTTP has been in use by the World Wide Web global information initiative since 1990. This document is Part 6 of the eight-part specification that defines the protocol referred to as "HTTP
 /1.1" and, taken together, updates RFC 2616 and RFC 2617. Part 4 defines requirements on HTTP caches and the associated header fields that control cache behavior or indicate cacheable response messages.</p> <hr class="noprint"><h1 class="np" id="rfc.toc"><a href="#rfc.toc">Table of Contents</a></h1><ul class="toc"><li class="tocline0">1.&nbsp;&nbsp;&nbsp;<a href="#rfc.section.1">Introduction</a><ul class="toc"><li class="tocline1">1.1&nbsp;&nbsp;&nbsp;<a href="#rfc.section.1.1">Terminology</a></li><li class="tocline1">1.2&nbsp;&nbsp;&nbsp;<a href="#delta.seconds">Delta Seconds</a></li></ul></li><li class="tocline0">2.&nbsp;&nbsp;&nbsp;<a href="#caching">Caching in HTTP</a><ul class="toc"><li class="tocline1">2.1&nbsp;&nbsp;&nbsp;<a href="#caching.overview">Overview</a><ul class="toc"><li class="tocline1">2.1.1&nbsp;&nbsp;&nbsp;<a href="#cache.correctness">Cache Correctness</a></li><li class="tocline1">2.1.2&nbsp;&nbsp;&nbsp;<a href="#warnings">Warnings</a></li><li class="toc
 line1">2.1.3&nbsp;&nbsp;&nbsp;<a href="#rfc.section.2.1.3">Cache-control Mechanisms</a></li><li class="tocline1">2.1.4&nbsp;&nbsp;&nbsp;<a href="#rfc.section.2.1.4">Explicit User Agent Warnings</a></li><li class="tocline1">2.1.5&nbsp;&nbsp;&nbsp;<a href="#exceptions.to.the.rules.and.warnings">Exceptions to the Rules and Warnings</a></li><li class="tocline1">2.1.6&nbsp;&nbsp;&nbsp;<a href="#rfc.section.2.1.6">Client-controlled Behavior</a></li></ul></li><li class="tocline1">2.2&nbsp;&nbsp;&nbsp;<a href="#expiration.model">Expiration Model</a><ul class="toc"><li class="tocline1">2.2.1&nbsp;&nbsp;&nbsp;<a href="#rfc.section.2.2.1">Server-Specified Expiration</a></li><li class="tocline1">2.2.2&nbsp;&nbsp;&nbsp;<a href="#rfc.section.2.2.2">Heuristic Expiration</a></li><li class="tocline1">2.2.3&nbsp;&nbsp;&nbsp;<a href="#age.calculations">Age Calculations</a></li><li class="tocline1">2.2.4&nbsp;&nbsp;&nbsp;<a href="#expiration.calculations">Expiration Calculations</a></li><li cla
 ss="tocline1">2.2.5&nbsp;&nbsp;&nbsp;<a href="#disambiguating.expiration.values">Disambiguating Expiration Values</a></li><li class="tocline1">2.2.6&nbsp;&nbsp;&nbsp;<a href="#disambiguating.multiple.responses">Disambiguating Multiple Responses</a></li></ul></li><li class="tocline1">2.3&nbsp;&nbsp;&nbsp;<a href="#validation.model">Validation Model</a><ul class="toc"><li class="tocline1">2.3.1&nbsp;&nbsp;&nbsp;<a href="#rfc.section.2.3.1">Last-Modified Dates</a></li><li class="tocline1">2.3.2&nbsp;&nbsp;&nbsp;<a href="#rfc.section.2.3.2">Entity Tag Cache Validators</a></li><li class="tocline1">2.3.3&nbsp;&nbsp;&nbsp;<a href="#rfc.section.2.3.3">Non-validating Conditionals</a></li></ul></li><li class="tocline1">2.4&nbsp;&nbsp;&nbsp;<a href="#response.cacheability">Response Cacheability</a></li><li class="tocline1">2.5&nbsp;&nbsp;&nbsp;<a href="#rfc.section.2.5">Constructing Responses From Caches</a><ul class="toc"><li class="tocline1">2.5.1&nbsp;&nbsp;&nbsp;<a href="#end-to-en
 d.and.hop-by-hop.headers">End-to-end and Hop-by-hop Headers</a></li><li class="tocline1">2.5.2&nbsp;&nbsp;&nbsp;<a href="#non-modifiable.headers">Non-modifiable Headers</a></li><li class="tocline1">2.5.3&nbsp;&nbsp;&nbsp;<a href="#combining.headers">Combining Headers</a></li></ul></li><li class="tocline1">2.6&nbsp;&nbsp;&nbsp;<a href="#caching.negotiated.responses">Caching Negotiated Responses</a></li><li class="tocline1">2.7&nbsp;&nbsp;&nbsp;<a href="#shared.and.non-shared.caches">Shared and Non-Shared Caches</a></li><li class="tocline1">2.8&nbsp;&nbsp;&nbsp;<a href="#errors.or.incomplete.response.cache.behavior">Errors or Incomplete Response Cache Behavior</a></li><li class="tocline1">2.9&nbsp;&nbsp;&nbsp;<a href="#rfc.section.2.9">Side Effects of GET and HEAD</a></li><li class="tocline1">2.10&nbsp;&nbsp;&nbsp;<a href="#invalidation.after.updates.or.deletions">Invalidation After Updates or Deletions</a></li><li class="tocline1">2.11&nbsp;&nbsp;&nbsp;<a href="#write-through
 .mandatory">Write-Through Mandatory</a></li><li class="tocline1">2.12&nbsp;&nbsp;&nbsp;<a href="#cache.replacement">Cache Replacement</a></li><li class="tocline1">2.13&nbsp;&nbsp;&nbsp;<a href="#history.lists">History Lists</a></li></ul></li><li class="tocline0">3.&nbsp;&nbsp;&nbsp;<a href="#rfc.section.3">Header Field Definitions</a><ul class="toc"><li class="tocline1">3.1&nbsp;&nbsp;&nbsp;<a href="#header.age">Age</a></li><li class="tocline1">3.2&nbsp;&nbsp;&nbsp;<a href="#header.cache-control">Cache-Control</a><ul class="toc"><li class="tocline1">3.2.1&nbsp;&nbsp;&nbsp;<a href="#what.is.cacheable">What is Cacheable</a></li><li class="tocline1">3.2.2&nbsp;&nbsp;&nbsp;<a href="#what.may.be.stored.by.caches">What May be Stored by Caches</a></li><li class="tocline1">3.2.3&nbsp;&nbsp;&nbsp;<a href="#modifications.of.the.basic.expiration.mechanism">Modifications of the Basic Expiration Mechanism</a></li><li class="tocline1">3.2.4&nbsp;&nbsp;&nbsp;<a href="#cache.revalidation.an
 d.reload.controls">Cache Revalidation and Reload Controls</a></li><li class="tocline1">3.2.5&nbsp;&nbsp;&nbsp;<a href="#no-transform.directive">No-Transform Directive</a></li><li class="tocline1">3.2.6&nbsp;&nbsp;&nbsp;<a href="#cache.control.extensions">Cache Control Extensions</a></li></ul></li><li class="tocline1">3.3&nbsp;&nbsp;&nbsp;<a href="#header.expires">Expires</a></li><li class="tocline1">3.4&nbsp;&nbsp;&nbsp;<a href="#header.pragma">Pragma</a></li><li class="tocline1">3.5&nbsp;&nbsp;&nbsp;<a href="#header.vary">Vary</a></li><li class="tocline1">3.6&nbsp;&nbsp;&nbsp;<a href="#header.warning">Warning</a></li></ul></li><li class="tocline0">4.&nbsp;&nbsp;&nbsp;<a href="#rfc.section.4">Security Considerations</a></li><li class="tocline0">5.&nbsp;&nbsp;&nbsp;<a href="#rfc.section.5">Acknowledgments</a></li><li class="tocline0">6.&nbsp;&nbsp;&nbsp;<a href="#rfc.references">References</a></li><li class="tocline0"><a href="#rfc.authors">Authors' Addresses</a></li><li clas
 s="tocline0">A.&nbsp;&nbsp;&nbsp;<a href="#changes.from.rfc.2068">Changes from RFC 2068</a></li><li class="tocline0"><a href="#rfc.ipr">Intellectual Property and Copyright Statements</a></li><li class="tocline0"><a href="#rfc.index">Index</a></li></ul><h1 id="rfc.section.1" class="np"><a href="#rfc.section.1">1.</a>&nbsp;Introduction</h1><p id="rfc.section.1.p.1">This document will define aspects of HTTP related to caching response messages. Right now it only includes the extracted relevant sections of <a href="#RFC2616">RFC 2616</a> <cite title="Hypertext Transfer Protocol -- HTTP/1.1" id="rfc.xref.RFC2616.1">[3]</cite> without edit.</p><h2 id="rfc.section.1.1"><a href="#rfc.section.1.1">1.1</a>&nbsp;Terminology</h2><p id="rfc.section.1.1.p.1">This specification uses a number of terms to refer to the roles played by participants in, and objects of, the HTTP communication.</p><p id="rfc.section.1.1.p.2"> <span id="rfc.iref.c.1"></span>  <dfn>cache</dfn>  </p><dl class="empty
 "><dd>A program's local store of response messages and the subsystem that controls its message storage, retrieval, and deletion. A cache stores cacheable responses in order to reduce the response time and network bandwidth consumption on future, equivalent requests. Any client or server may include a cache, though a cache cannot be used by a server that is acting as a tunnel.</dd></dl><p id="rfc.section.1.1.p.3"> <span id="rfc.iref.c.2"></span>  <dfn>cacheable</dfn>  </p><dl class="empty"><dd>A response is cacheable if a cache is allowed to store a copy of the response message for use in answering subsequent requests. The rules for determining the cacheability of HTTP responses are defined in <a href="#caching" title="Caching in HTTP">Section&nbsp;2</a>. Even if a resource is cacheable, there may be additional constraints on whether a cache can use the cached copy for a particular request.</dd></dl><p id="rfc.section.1.1.p.4"> <span id="rfc.iref.f.1"></span>  <dfn>first-hand
 </dfn>  </p><dl class="empty"><dd>A response is first-hand if it comes directly and without unnecessary delay from the origin server, perhaps via one or more proxies. A response is also first-hand if its validity has just been checked directly with the origin server.</dd></dl><p id="rfc.section.1.1.p.5"> <span id="rfc.iref.e.1"></span>  <dfn>explicit expiration time</dfn>  </p><dl class="empty"><dd>The time at which the origin server intends that an entity should no longer be returned by a cache without further validation.</dd></dl><p id="rfc.section.1.1.p.6"> <span id="rfc.iref.h.1"></span>  <dfn>heuristic expiration time</dfn>  </p><dl class="empty"><dd>An expiration time assigned by a cache when no explicit expiration time is available.</dd></dl><p id="rfc.section.1.1.p.7"> <span id="rfc.iref.a.1"></span>  <dfn>age</dfn>  </p><dl class="empty"><dd>The age of a response is the time since it was sent by, or successfully validated with, the origin server.</dd></dl><p id="rfc
 .section.1.1.p.8"> <span id="rfc.iref.f.2"></span>  <dfn>freshness lifetime</dfn>  </p><dl class="empty"><dd>The length of time between the generation of a response and its expiration time.</dd></dl><p id="rfc.section.1.1.p.9"> <span id="rfc.iref.f.3"></span>  <dfn>fresh</dfn>  </p><dl class="empty"><dd>A response is fresh if its age has not yet exceeded its freshness lifetime.</dd></dl><p id="rfc.section.1.1.p.10"> <span id="rfc.iref.s.1"></span>  <dfn>stale</dfn>  </p><dl class="empty"><dd>A response is stale if its age has passed its freshness lifetime.</dd></dl><p id="rfc.section.1.1.p.11"> <span id="rfc.iref.s.2"></span>  <dfn>semantically transparent</dfn>  </p><dl class="empty"><dd>A cache behaves in a "semantically transparent" manner, with respect to a particular response, when its use affects neither the requesting client nor the origin server, except to improve performance. When a cache is semantically transparent, the client receives exactly the same response (ex
 cept for hop-by-hop headers) that it would have received had its request been handled directly by the origin server.</dd></dl><p id="rfc.section.1.1.p.12"> <span id="rfc.iref.v.1"></span>  <dfn>validator</dfn>  </p><dl class="empty"><dd>A protocol element (e.g., an entity tag or a Last-Modified time) that is used to find out whether a cache entry is an equivalent copy of an entity.</dd></dl><h2 id="rfc.section.1.2"><a href="#rfc.section.1.2">1.2</a>&nbsp;<a id="delta.seconds" href="#delta.seconds">Delta Seconds</a></h2><p id="rfc.section.1.2.p.1">Some HTTP header fields allow a time value to be specified as an integer number of seconds, represented in decimal, after the time that the message was received.</p><div id="rfc.figure.u.1"></div><pre class="inline"><span id="rfc.iref.g.1"></span>    delta-seconds  = 1*DIGIT
+</pre><h1 id="rfc.section.2"><a href="#rfc.section.2">2.</a>&nbsp;<a id="caching" href="#caching">Caching in HTTP</a></h1><h2 id="rfc.section.2.1"><a href="#rfc.section.2.1">2.1</a>&nbsp;<a id="caching.overview" href="#caching.overview">Overview</a></h2><p id="rfc.section.2.1.p.1">HTTP is typically used for distributed information systems, where performance can be improved by the use of response caches. The HTTP/1.1 protocol includes a number of elements intended to make caching work as well as possible. Because these elements are inextricable from other aspects of the protocol, and because they interact with each other, it is useful to describe the basic caching design of HTTP separately from the detailed descriptions of methods, headers, response codes, etc.</p><p id="rfc.section.2.1.p.2">Caching would be useless if it did not significantly improve performance. The goal of caching in HTTP/1.1 is to eliminate the need to send requests in many cases, and to eliminate the nee
 d to send full responses in many other cases. The former reduces the number of network round-trips required for many operations; we use an "expiration" mechanism for this purpose (see <a href="#expiration.model" title="Expiration Model">Section&nbsp;2.2</a>). The latter reduces network bandwidth requirements; we use a "validation" mechanism for this purpose (see <a href="#validation.model" title="Validation Model">Section&nbsp;2.3</a>).</p><p id="rfc.section.2.1.p.3">Requirements for performance, availability, and disconnected operation require us to be able to relax the goal of semantic transparency. The HTTP/1.1 protocol allows origin servers, caches, and clients to explicitly reduce transparency when necessary. However, because non-transparent operation may confuse non-expert users, and might be incompatible with certain server applications (such as those for ordering merchandise), the protocol requires that transparency be relaxed </p><ul><li>only by an explicit protocol
 -level request when relaxed by client or origin server</li><li>only with an explicit warning to the end user when relaxed by cache or client</li></ul><p id="rfc.section.2.1.p.4">Therefore, the HTTP/1.1 protocol provides these important elements: </p><ol><li>Protocol features that provide full semantic transparency when this is required by all parties.</li><li>Protocol features that allow an origin server or user agent to explicitly request and control non-transparent operation.</li><li>Protocol features that allow a cache to attach warnings to responses that do not preserve the requested approximation of semantic transparency.</li></ol><p id="rfc.section.2.1.p.5">A basic principle is that it must be possible for the clients to detect any potential relaxation of semantic transparency. </p><dl class="empty"><dd> <b>Note:</b> The server, cache, or client implementor might be faced with design decisions not explicitly discussed in this specification. If a decision might affect s
 emantic transparency, the implementor ought to err on the side of maintaining transparency unless a careful and complete analysis shows significant benefits in breaking transparency.</dd></dl><h3 id="rfc.section.2.1.1"><a href="#rfc.section.2.1.1">2.1.1</a>&nbsp;<a id="cache.correctness" href="#cache.correctness">Cache Correctness</a></h3><p id="rfc.section.2.1.1.p.1">A correct cache <em class="bcp14">MUST</em> respond to a request with the most up-to-date response held by the cache that is appropriate to the request (see sections <a href="#disambiguating.expiration.values" title="Disambiguating Expiration Values">2.2.5</a>, <a href="#disambiguating.multiple.responses" title="Disambiguating Multiple Responses">2.2.6</a>, and <a href="#cache.replacement" title="Cache Replacement">2.12</a>) which meets one of the following conditions: </p><ol><li>It has been checked for equivalence with what the origin server would have returned by revalidating the response with the origin ser
 ver (<a href="#validation.model" title="Validation Model">Section&nbsp;2.3</a>);</li><li>It is "fresh enough" (see <a href="#expiration.model" title="Expiration Model">Section&nbsp;2.2</a>). In the default case, this means it meets the least restrictive freshness requirement of the client, origin server, and cache (see <a href="#header.cache-control" id="rfc.xref.header.cache-control.1" title="Cache-Control">Section&nbsp;3.2</a>); if the origin server so specifies, it is the freshness requirement of the origin server alone. If a stored response is not "fresh enough" by the most restrictive freshness requirement of both the client and the origin server, in carefully considered circumstances the cache <em class="bcp14">MAY</em> still return the response with the appropriate Warning header (see section <a href="#exceptions.to.the.rules.and.warnings" title="Exceptions to the Rules and Warnings">2.1.5</a> and <a href="#header.warning" id="rfc.xref.header.warning.1" title="Warning
 ">3.6</a>), unless such a response is prohibited (e.g., by a "no-store" cache-directive, or by a "no-cache" cache-request-directive; see <a href="#header.cache-control" id="rfc.xref.header.cache-control.2" title="Cache-Control">Section&nbsp;3.2</a>).</li><li>It is an appropriate 304 (Not Modified), 305 (Proxy Redirect), or error (4xx or 5xx) response message.</li></ol><p id="rfc.section.2.1.1.p.2">If the cache can not communicate with the origin server, then a correct cache <em class="bcp14">SHOULD</em> respond as above if the response can be correctly served from the cache; if not it <em class="bcp14">MUST</em> return an error or warning indicating that there was a communication failure.</p><p id="rfc.section.2.1.1.p.3">If a cache receives a response (either an entire response, or a 304 (Not Modified) response) that it would normally forward to the requesting client, and the received response is no longer fresh, the cache <em class="bcp14">SHOULD</em> forward it to the requ
 esting client without adding a new Warning (but without removing any existing Warning headers). A cache <em class="bcp14">SHOULD NOT</em> attempt to revalidate a response simply because that response became stale in transit; this might lead to an infinite loop. A user agent that receives a stale response without a Warning <em class="bcp14">MAY</em> display a warning indication to the user.</p><h3 id="rfc.section.2.1.2"><a href="#rfc.section.2.1.2">2.1.2</a>&nbsp;<a id="warnings" href="#warnings">Warnings</a></h3><p id="rfc.section.2.1.2.p.1">Whenever a cache returns a response that is neither first-hand nor "fresh enough" (in the sense of condition 2 in <a href="#cache.correctness" title="Cache Correctness">Section&nbsp;2.1.1</a>), it <em class="bcp14">MUST</em> attach a warning to that effect, using a Warning general-header. The Warning header and the currently defined warnings are described in <a href="#header.warning" id="rfc.xref.header.warning.2" title="Warning">Section
 &nbsp;3.6</a>. The warning allows clients to take appropriate action.</p><p id="rfc.section.2.1.2.p.2">Warnings <em class="bcp14">MAY</em> be used for other purposes, both cache-related and otherwise. The use of a warning, rather than an error status code, distinguish these responses from true failures.</p><p id="rfc.section.2.1.2.p.3">Warnings are assigned three digit warn-codes. The first digit indicates whether the Warning <em class="bcp14">MUST</em> or <em class="bcp14">MUST NOT</em> be deleted from a stored cache entry after a successful revalidation:</p><p id="rfc.section.2.1.2.p.4"> </p><dl><dt>1xx</dt><dd>Warnings that describe the freshness or revalidation status of the response, and so <em class="bcp14">MUST</em> be deleted after a successful revalidation. 1XX warn-codes <em class="bcp14">MAY</em> be generated by a cache only when validating a cached entry. It <em class="bcp14">MUST NOT</em> be generated by clients.</dd><dt>2xx</dt><dd>Warnings that describe some a
 spect of the entity body or entity headers that is not rectified by a revalidation (for example, a lossy compression of the entity bodies) and which <em class="bcp14">MUST NOT</em> be deleted after a successful revalidation.</dd></dl><p id="rfc.section.2.1.2.p.5">See <a href="#header.warning" id="rfc.xref.header.warning.3" title="Warning">Section&nbsp;3.6</a> for the definitions of the codes themselves.</p><p id="rfc.section.2.1.2.p.6">HTTP/1.0 caches will cache all Warnings in responses, without deleting the ones in the first category. Warnings in responses that are passed to HTTP/1.0 caches carry an extra warning-date field, which prevents a future HTTP/1.1 recipient from believing an erroneously cached Warning.</p><p id="rfc.section.2.1.2.p.7">Warnings also carry a warning text. The text <em class="bcp14">MAY</em> be in any appropriate natural language (perhaps based on the client's Accept headers), and include an <em class="bcp14">OPTIONAL</em> indication of what charact
 er set is used.</p><p id="rfc.section.2.1.2.p.8">Multiple warnings <em class="bcp14">MAY</em> be attached to a response (either by the origin server or by a cache), including multiple warnings with the same code number. For example, a server might provide the same warning with texts in both English and Basque.</p><p id="rfc.section.2.1.2.p.9">When multiple warnings are attached to a response, it might not be practical or reasonable to display all of them to the user. This version of HTTP does not specify strict priority rules for deciding which warnings to display and in what order, but does suggest some heuristics.</p><h3 id="rfc.section.2.1.3"><a href="#rfc.section.2.1.3">2.1.3</a>&nbsp;Cache-control Mechanisms</h3><p id="rfc.section.2.1.3.p.1">The basic cache mechanisms in HTTP/1.1 (server-specified expiration times and validators) are implicit directives to caches. In some cases, a server or client might need to provide explicit directives to the HTTP caches. We use the 
 Cache-Control header for this purpose.</p><p id="rfc.section.2.1.3.p.2">The Cache-Control header allows a client or server to transmit a variety of directives in either requests or responses. These directives typically override the default caching algorithms. As a general rule, if there is any apparent conflict between header values, the most restrictive interpretation is applied (that is, the one that is most likely to preserve semantic transparency). However, in some cases, cache-control directives are explicitly specified as weakening the approximation of semantic transparency (for example, "max-stale" or "public").</p><p id="rfc.section.2.1.3.p.3">The cache-control directives are described in detail in <a href="#header.cache-control" id="rfc.xref.header.cache-control.3" title="Cache-Control">Section&nbsp;3.2</a>.</p><h3 id="rfc.section.2.1.4"><a href="#rfc.section.2.1.4">2.1.4</a>&nbsp;Explicit User Agent Warnings</h3><p id="rfc.section.2.1.4.p.1">Many user agents make i
 t possible for users to override the basic caching mechanisms. For example, the user agent might allow the user to specify that cached entities (even explicitly stale ones) are never validated. Or the user agent might habitually add "Cache-Control: max-stale=3600" to every request. The user agent <em class="bcp14">SHOULD NOT</em> default to either non-transparent behavior, or behavior that results in abnormally ineffective caching, but <em class="bcp14">MAY</em> be explicitly configured to do so by an explicit action of the user.</p><p id="rfc.section.2.1.4.p.2">If the user has overridden the basic caching mechanisms, the user agent <em class="bcp14">SHOULD</em> explicitly indicate to the user whenever this results in the display of information that might not meet the server's transparency requirements (in particular, if the displayed entity is known to be stale). Since the protocol normally allows the user agent to determine if responses are stale or not, this indication ne
 ed only be displayed when this actually happens. The indication need not be a dialog box; it could be an icon (for example, a picture of a rotting fish) or some other indicator.</p><p id="rfc.section.2.1.4.p.3">If the user has overridden the caching mechanisms in a way that would abnormally reduce the effectiveness of caches, the user agent <em class="bcp14">SHOULD</em> continually indicate this state to the user (for example, by a display of a picture of currency in flames) so that the user does not inadvertently consume excess resources or suffer from excessive latency.</p><h3 id="rfc.section.2.1.5"><a href="#rfc.section.2.1.5">2.1.5</a>&nbsp;<a id="exceptions.to.the.rules.and.warnings" href="#exceptions.to.the.rules.and.warnings">Exceptions to the Rules and Warnings</a></h3><p id="rfc.section.2.1.5.p.1">In some cases, the operator of a cache <em class="bcp14">MAY</em> choose to configure it to return stale responses even when not requested by clients. This decision ought 
 not be made lightly, but may be necessary for reasons of availability or performance, especially when the cache is poorly connected to the origin server. Whenever a cache returns a stale response, it <em class="bcp14">MUST</em> mark it as such (using a Warning header) enabling the client software to alert the user that there might be a potential problem.</p><p id="rfc.section.2.1.5.p.2">It also allows the user agent to take steps to obtain a first-hand or fresh response. For this reason, a cache <em class="bcp14">SHOULD NOT</em> return a stale response if the client explicitly requests a first-hand or fresh one, unless it is impossible to comply for technical or policy reasons.</p><h3 id="rfc.section.2.1.6"><a href="#rfc.section.2.1.6">2.1.6</a>&nbsp;Client-controlled Behavior</h3><p id="rfc.section.2.1.6.p.1">While the origin server (and to a lesser extent, intermediate caches, by their contribution to the age of a response) are the primary source of expiration information,
  in some cases the client might need to control a cache's decision about whether to return a cached response without validating it. Clients do this using several directives of the Cache-Control header.</p><p id="rfc.section.2.1.6.p.2">A client's request <em class="bcp14">MAY</em> specify the maximum age it is willing to accept of an unvalidated response; specifying a value of zero forces the cache(s) to revalidate all responses. A client <em class="bcp14">MAY</em> also specify the minimum time remaining before a response expires. Both of these options increase constraints on the behavior of caches, and so cannot further relax the cache's approximation of semantic transparency.</p><p id="rfc.section.2.1.6.p.3">A client <em class="bcp14">MAY</em> also specify that it will accept stale responses, up to some maximum amount of staleness. This loosens the constraints on the caches, and so might violate the origin server's specified constraints on semantic transparency, but might b
 e necessary to support disconnected operation, or high availability in the face of poor connectivity.</p><h2 id="rfc.section.2.2"><a href="#rfc.section.2.2">2.2</a>&nbsp;<a id="expiration.model" href="#expiration.model">Expiration Model</a></h2><h3 id="rfc.section.2.2.1"><a href="#rfc.section.2.2.1">2.2.1</a>&nbsp;Server-Specified Expiration</h3><p id="rfc.section.2.2.1.p.1">HTTP caching works best when caches can entirely avoid making requests to the origin server. The primary mechanism for avoiding requests is for an origin server to provide an explicit expiration time in the future, indicating that a response <em class="bcp14">MAY</em> be used to satisfy subsequent requests. In other words, a cache can return a fresh response without first contacting the server.</p><p id="rfc.section.2.2.1.p.2">Our expectation is that servers will assign future explicit expiration times to responses in the belief that the entity is not likely to change, in a semantically significant way, 
 before the expiration time is reached. This normally preserves semantic transparency, as long as the server's expiration times are carefully chosen.</p><p id="rfc.section.2.2.1.p.3">The expiration mechanism applies only to responses taken from a cache and not to first-hand responses forwarded immediately to the requesting client.</p><p id="rfc.section.2.2.1.p.4">If an origin server wishes to force a semantically transparent cache to validate every request, it <em class="bcp14">MAY</em> assign an explicit expiration time in the past. This means that the response is always stale, and so the cache <em class="bcp14">SHOULD</em> validate it before using it for subsequent requests. See <a href="#cache.revalidation.and.reload.controls" title="Cache Revalidation and Reload Controls">Section&nbsp;3.2.4</a> for a more restrictive way to force revalidation.</p><p id="rfc.section.2.2.1.p.5">If an origin server wishes to force any HTTP/1.1 cache, no matter how it is configured, to valida
 te every request, it <em class="bcp14">SHOULD</em> use the "must-revalidate" cache-control directive (see <a href="#header.cache-control" id="rfc.xref.header.cache-control.4" title="Cache-Control">Section&nbsp;3.2</a>).</p><p id="rfc.section.2.2.1.p.6">Servers specify explicit expiration times using either the Expires header, or the max-age directive of the Cache-Control header.</p><p id="rfc.section.2.2.1.p.7">An expiration time cannot be used to force a user agent to refresh its display or reload a resource; its semantics apply only to caching mechanisms, and such mechanisms need only check a resource's expiration status when a new request for that resource is initiated. See <a href="#history.lists" title="History Lists">Section&nbsp;2.13</a> for an explanation of the difference between caches and history mechanisms.</p><h3 id="rfc.section.2.2.2"><a href="#rfc.section.2.2.2">2.2.2</a>&nbsp;Heuristic Expiration</h3><p id="rfc.section.2.2.2.p.1">Since origin servers do not a
 lways provide explicit expiration times, HTTP caches typically assign heuristic expiration times, employing algorithms that use other header values (such as the Last-Modified time) to estimate a plausible expiration time. The HTTP/1.1 specification does not provide specific algorithms, but does impose worst-case constraints on their results. Since heuristic expiration times might compromise semantic transparency, they ought to used cautiously, and we encourage origin servers to provide explicit expiration times as much as possible.</p><h3 id="rfc.section.2.2.3"><a href="#rfc.section.2.2.3">2.2.3</a>&nbsp;<a id="age.calculations" href="#age.calculations">Age Calculations</a></h3><p id="rfc.section.2.2.3.p.1">In order to know if a cached entry is fresh, a cache needs to know if its age exceeds its freshness lifetime. We discuss how to calculate the latter in <a href="#expiration.calculations" title="Expiration Calculations">Section&nbsp;2.2.4</a>; this section describes how to
  calculate the age of a response or cache entry.</p><p id="rfc.section.2.2.3.p.2">In this discussion, we use the term "now" to mean "the current value of the clock at the host performing the calculation." Hosts that use HTTP, but especially hosts running origin servers and caches, <em class="bcp14">SHOULD</em> use NTP <a href="#RFC1305" id="rfc.xref.RFC1305.1"><cite title="Network Time Protocol (Version 3) Specification, Implementation">[2]</cite></a> or some similar protocol to synchronize their clocks to a globally accurate time standard.</p><p id="rfc.section.2.2.3.p.3">HTTP/1.1 requires origin servers to send a Date header, if possible, with every response, giving the time at which the response was generated (see [Part 1]). We use the term "date_value" to denote the value of the Date header, in a form appropriate for arithmetic operations.</p><p id="rfc.section.2.2.3.p.4">HTTP/1.1 uses the Age response-header to convey the estimated age of the response message when obtai
 ned from a cache. The Age field value is the cache's estimate of the amount of time since the response was generated or revalidated by the origin server.</p><p id="rfc.section.2.2.3.p.5">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.</p><p id="rfc.section.2.2.3.p.6">We use the term "age_value" to denote the value of the Age header, in a form appropriate for arithmetic operations.</p><p id="rfc.section.2.2.3.p.7">A response's age can be calculated in two entirely independent ways: </p><ol><li>now 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>age_value, if all of the caches along the response path implement HTTP/1.1.</li></ol><p id="rfc.section.2.2.3.p.8">Given that we have two independent ways 
 to compute the age of a response when it is received, we can combine these as</p><div id="rfc.figure.u.2"></div><pre class="text">    corrected_received_age = max(now - date_value, age_value)
+</pre><p id="rfc.section.2.2.3.p.10">and as long as we have either nearly synchronized clocks or all-HTTP/1.1 paths, one gets a reliable (conservative) result.</p><p id="rfc.section.2.2.3.p.11">Because of network-imposed delays, some significant interval might pass between the time that a server generates a response and the time it is received at the next outbound cache or client. If uncorrected, this delay could result in improperly low ages.</p><p id="rfc.section.2.2.3.p.12">Because the request that resulted in the returned Age value must have been initiated prior to that Age value's generation, we can correct for delays imposed by the network by recording the time at which the request was initiated. Then, when an Age value is received, it <em class="bcp14">MUST</em> be interpreted relative to the time the request was initiated, not the time that the response was received. This algorithm results in conservative behavior no matter how much delay is experienced. So, we compu
 te:</p><div id="rfc.figure.u.3"></div><pre class="text">   corrected_initial_age = corrected_received_age
+                         + (now - request_time)
+</pre><p id="rfc.section.2.2.3.p.14">where "request_time" is the time (according to the local clock) when the request that elicited this response was sent.</p><p id="rfc.section.2.2.3.p.15">Summary of age calculation algorithm, when a cache receives a response:</p><div id="rfc.figure.u.4"></div><pre class="text">   /*
+    * age_value
+    *      is the value of Age: header received by the cache with
+    *              this response.
+    * date_value
+    *      is the value of the origin server's Date: header
+    * request_time
+    *      is the (local) time when the cache made the request
+    *              that resulted in this cached response
+    * response_time
+    *      is the (local) time when the cache received the
+    *              response
+    * now
+    *      is the current (local) time
+    */
+
+   apparent_age = max(0, response_time - date_value);
+   corrected_received_age = max(apparent_age, age_value);
+   response_delay = response_time - request_time;
+   corrected_initial_age = corrected_received_age + response_delay;
+   resident_time = now - response_time;
+   current_age   = corrected_initial_age + resident_time;
+</pre><p id="rfc.section.2.2.3.p.17">The current_age of a cache entry is calculated by adding the amount of time (in seconds) since the cache entry was last validated by the origin server to the corrected_initial_age. When a response is generated from a cache entry, the cache <em class="bcp14">MUST</em> include a single Age header field in the response with a value equal to the cache entry's current_age.</p><p id="rfc.section.2.2.3.p.18">The presence of an Age header field in a response implies that a response is not first-hand. However, the converse is not true, since the lack of an Age header field in a response does not imply that the response is first-hand unless all caches along the request path are compliant with HTTP/1.1 (i.e., older HTTP caches did not implement the Age header field).</p><h3 id="rfc.section.2.2.4"><a href="#rfc.section.2.2.4">2.2.4</a>&nbsp;<a id="expiration.calculations" href="#expiration.calculations">Expiration Calculations</a></h3><p id="rfc.sect
 ion.2.2.4.p.1">In order to decide whether a response is fresh or stale, we need to compare its freshness lifetime to its age. The age is calculated as described in <a href="#age.calculations" title="Age Calculations">Section&nbsp;2.2.3</a>; this section describes how to calculate the freshness lifetime, and to determine if a response has expired. In the discussion below, the values can be represented in any form appropriate for arithmetic operations.</p><p id="rfc.section.2.2.4.p.2">We use the term "expires_value" to denote the value of the Expires header. We use the term "max_age_value" to denote an appropriate value of the number of seconds carried by the "max-age" directive of the Cache-Control header in a response (see <a href="#modifications.of.the.basic.expiration.mechanism" title="Modifications of the Basic Expiration Mechanism">Section&nbsp;3.2.3</a>).</p><p id="rfc.section.2.2.4.p.3">The max-age directive takes priority over Expires, so if max-age is present in a re
 sponse, the calculation is simply:</p><div id="rfc.figure.u.5"></div><pre class="text">   freshness_lifetime = max_age_value
+</pre><p id="rfc.section.2.2.4.p.5">Otherwise, if Expires is present in the response, the calculation is:</p><div id="rfc.figure.u.6"></div><pre class="text">   freshness_lifetime = expires_value - date_value
+</pre><p id="rfc.section.2.2.4.p.7">Note that neither of these calculations is vulnerable to clock skew, since all of the information comes from the origin server.</p><p id="rfc.section.2.2.4.p.8">If none of Expires, Cache-Control: max-age, or Cache-Control: s-maxage (see <a href="#modifications.of.the.basic.expiration.mechanism" title="Modifications of the Basic Expiration Mechanism">Section&nbsp;3.2.3</a>) appears in the response, and the response does not include other restrictions on caching, the cache <em class="bcp14">MAY</em> compute a freshness lifetime using a heuristic. The cache <em class="bcp14">MUST</em> attach Warning 113 to any response whose age is more than 24 hours if such warning has not already been added.</p><p id="rfc.section.2.2.4.p.9">Also, if the response does have a Last-Modified time, the heuristic expiration value <em class="bcp14">SHOULD</em> be no more than some fraction of the interval since that time. A typical setting of this fraction might b
 e 10%.</p><p id="rfc.section.2.2.4.p.10">The calculation to determine if a response has expired is quite simple:</p><div id="rfc.figure.u.7"></div><pre class="text">   response_is_fresh = (freshness_lifetime &gt; current_age)
+</pre><h3 id="rfc.section.2.2.5"><a href="#rfc.section.2.2.5">2.2.5</a>&nbsp;<a id="disambiguating.expiration.values" href="#disambiguating.expiration.values">Disambiguating Expiration Values</a></h3><p id="rfc.section.2.2.5.p.1">Because expiration values are assigned optimistically, it is possible for two caches to contain fresh values for the same resource that are different.</p><p id="rfc.section.2.2.5.p.2">If a client performing a retrieval receives a non-first-hand response for a request that was already fresh in its own cache, and the Date header in its existing cache entry is newer than the Date on the new response, then the client <em class="bcp14">MAY</em> ignore the response. If so, it <em class="bcp14">MAY</em> retry the request with a "Cache-Control: max-age=0" directive (see <a href="#header.cache-control" id="rfc.xref.header.cache-control.5" title="Cache-Control">Section&nbsp;3.2</a>), to force a check with the origin server.</p><p id="rfc.section.2.2.5.p.3">If
  a cache has two fresh responses for the same representation with different validators, it <em class="bcp14">MUST</em> use the one with the more recent Date header. This situation might arise because the cache is pooling responses from other caches, or because a client has asked for a reload or a revalidation of an apparently fresh cache entry.</p><h3 id="rfc.section.2.2.6"><a href="#rfc.section.2.2.6">2.2.6</a>&nbsp;<a id="disambiguating.multiple.responses" href="#disambiguating.multiple.responses">Disambiguating Multiple Responses</a></h3><p id="rfc.section.2.2.6.p.1">Because a client might be receiving responses via multiple paths, so that some responses flow through one set of caches and other responses flow through a different set of caches, a client might receive responses in an order different from that in which the origin server sent them. We would like the client to use the most recently generated response, even if older responses are still apparently fresh.</p><p i
 d="rfc.section.2.2.6.p.2">Neither the entity tag nor the expiration value can impose an ordering on responses, since it is possible that a later response intentionally carries an earlier expiration time. The Date values are ordered to a granularity of one second.</p><p id="rfc.section.2.2.6.p.3">When a client tries to revalidate a cache entry, and the response it receives contains a Date header that appears to be older than the one for the existing entry, then the client <em class="bcp14">SHOULD</em> repeat the request unconditionally, and include</p><div id="rfc.figure.u.8"></div><pre class="text">    Cache-Control: max-age=0
+</pre><p id="rfc.section.2.2.6.p.5">to force any intermediate caches to validate their copies directly with the origin server, or</p><div id="rfc.figure.u.9"></div><pre class="text">    Cache-Control: no-cache
+</pre><p id="rfc.section.2.2.6.p.7">to force any intermediate caches to obtain a new copy from the origin server.</p><p id="rfc.section.2.2.6.p.8">If the Date values are equal, then the client <em class="bcp14">MAY</em> use either response (or <em class="bcp14">MAY</em>, if it is being extremely prudent, request a new response). Servers <em class="bcp14">MUST NOT</em> depend on clients being able to choose deterministically between responses generated during the same second, if their expiration times overlap.</p><h2 id="rfc.section.2.3"><a href="#rfc.section.2.3">2.3</a>&nbsp;<a id="validation.model" href="#validation.model">Validation Model</a></h2><p id="rfc.section.2.3.p.1">When a cache has a stale entry that it would like to use as a response to a client's request, it first has to check with the origin server (or possibly an intermediate cache with a fresh response) to see if its cached entry is still usable. We call this "validating" the cache entry. Since we do not wan
 t to have to pay the overhead of retransmitting the full response if the cached entry is good, and we do not want to pay the overhead of an extra round trip if the cached entry is invalid, the HTTP/1.1 protocol supports the use of conditional methods.</p><p id="rfc.section.2.3.p.2">The key protocol features for supporting conditional methods are those concerned with "cache validators." When an origin server generates a full response, it attaches some sort of validator to it, which is kept with the cache entry. When a client (user agent or proxy cache) makes a conditional request for a resource for which it has a cache entry, it includes the associated validator in the request.</p><p id="rfc.section.2.3.p.3">The server then checks that validator against the current validator for the entity, and, if they match (see [Part 4]), it responds with a special status code (usually, 304 (Not Modified)) and no entity-body. Otherwise, it returns a full response (including entity-body). T
 hus, we avoid transmitting the full response if the validator matches, and we avoid an extra round trip if it does not match.</p><p id="rfc.section.2.3.p.4">In HTTP/1.1, a conditional request looks exactly the same as a normal request for the same resource, except that it carries a special header (which includes the validator) that implicitly turns the method (usually, GET) into a conditional.</p><p id="rfc.section.2.3.p.5">The protocol includes both positive and negative senses of cache-validating conditions. That is, it is possible to request either that a method be performed if and only if a validator matches or if and only if no validators match. </p><dl class="empty"><dd> <b>Note:</b> a response that lacks a validator may still be cached, and served from cache until it expires, unless this is explicitly prohibited by a cache-control directive. However, a cache cannot do a conditional retrieval if it does not have a validator for the entity, which means it will not be re
 freshable after it expires.</dd></dl><h3 id="rfc.section.2.3.1"><a href="#rfc.section.2.3.1">2.3.1</a>&nbsp;Last-Modified Dates</h3><p id="rfc.section.2.3.1.p.1">The Last-Modified entity-header field value is often used as a cache validator. In simple terms, a cache entry is considered to be valid if the entity has not been modified since the Last-Modified value.</p><h3 id="rfc.section.2.3.2"><a href="#rfc.section.2.3.2">2.3.2</a>&nbsp;Entity Tag Cache Validators</h3><p id="rfc.section.2.3.2.p.1">The ETag response-header field value, an entity tag, provides for an "opaque" cache validator. This might allow more reliable validation in situations where it is inconvenient to store modification dates, where the one-second resolution of HTTP date values is not sufficient, or where the origin server wishes to avoid certain paradoxes that might arise from the use of modification dates.</p><p id="rfc.section.2.3.2.p.2">Entity Tags are described in [Part 4].</p><h3 id="rfc.section.2.
 3.3"><a href="#rfc.section.2.3.3">2.3.3</a>&nbsp;Non-validating Conditionals</h3><p id="rfc.section.2.3.3.p.1">The principle behind entity tags is that only the service author knows the semantics of a resource well enough to select an appropriate cache validation mechanism, and the specification of any validator comparison function more complex than byte-equality would open up a can of worms. Thus, comparisons of any other headers (except Last-Modified, for compatibility with HTTP/1.0) are never used for purposes of validating a cache entry.</p><h2 id="rfc.section.2.4"><a href="#rfc.section.2.4">2.4</a>&nbsp;<a id="response.cacheability" href="#response.cacheability">Response Cacheability</a></h2><p id="rfc.section.2.4.p.1">Unless specifically constrained by a cache-control (<a href="#header.cache-control" id="rfc.xref.header.cache-control.6" title="Cache-Control">Section&nbsp;3.2</a>) directive, a caching system <em class="bcp14">MAY</em> always store a successful response 
 (see <a href="#errors.or.incomplete.response.cache.behavior" title="Errors or Incomplete Response Cache Behavior">Section&nbsp;2.8</a>) as a cache entry, <em class="bcp14">MAY</em> return it without validation if it is fresh, and <em class="bcp14">MAY</em> return it after successful validation. If there is neither a cache validator nor an explicit expiration time associated with a response, we do not expect it to be cached, but certain caches <em class="bcp14">MAY</em> violate this expectation (for example, when little or no network connectivity is available). A client can usually detect that such a response was taken from a cache by comparing the Date header to the current time. </p><dl class="empty"><dd> <b>Note:</b> some HTTP/1.0 caches are known to violate this expectation without providing any Warning.</dd></dl><p id="rfc.section.2.4.p.2">However, in some cases it might be inappropriate for a cache to retain an entity, or to return it in response to a subsequent request
 . This might be because absolute semantic transparency is deemed necessary by the service author, or because of security or privacy considerations. Certain cache-control directives are therefore provided so that the server can indicate that certain resource entities, or portions thereof, are not to be cached regardless of other considerations.</p><p id="rfc.section.2.4.p.3">Note that [Part 7] normally prevents a shared cache from saving and returning a response to a previous request if that request included an Authorization header.</p><p id="rfc.section.2.4.p.4">A response received with a status code of 200, 203, 206, 300, 301 or 410 <em class="bcp14">MAY</em> be stored by a cache and used in reply to a subsequent request, subject to the expiration mechanism, unless a cache-control directive prohibits caching. However, a cache that does not support the Range and Content-Range headers <em class="bcp14">MUST NOT</em> cache 206 (Partial Content) responses.</p><p id="rfc.section
 .2.4.p.5">A response received with any other status code (e.g. status codes 302 and 307) <em class="bcp14">MUST NOT</em> be returned in a reply to a subsequent request unless there are cache-control directives or another header(s) that explicitly allow it. For example, these include the following: an Expires header (<a href="#header.expires" id="rfc.xref.header.expires.1" title="Expires">Section&nbsp;3.3</a>); a "max-age", "s-maxage", "must-revalidate", "proxy-revalidate", "public" or "private" cache-control directive (<a href="#header.cache-control" id="rfc.xref.header.cache-control.7" title="Cache-Control">Section&nbsp;3.2</a>).</p><h2 id="rfc.section.2.5"><a href="#rfc.section.2.5">2.5</a>&nbsp;Constructing Responses From Caches</h2><p id="rfc.section.2.5.p.1">The purpose of an HTTP cache is to store information received in response to requests for use in responding to future requests. In many cases, a cache simply returns the appropriate parts of a response to the reques
 ter. However, if the cache holds a cache entry based on a previous response, it might have to combine parts of a new response with what is held in the cache entry.</p><h3 id="rfc.section.2.5.1"><a href="#rfc.section.2.5.1">2.5.1</a>&nbsp;<a id="end-to-end.and.hop-by-hop.headers" href="#end-to-end.and.hop-by-hop.headers">End-to-end and Hop-by-hop Headers</a></h3><p id="rfc.section.2.5.1.p.1">For the purpose of defining the behavior of caches and non-caching proxies, we divide HTTP headers into two categories: </p><ul><li>End-to-end headers, which are transmitted to the ultimate recipient of a request or response. End-to-end headers in responses <em class="bcp14">MUST</em> be stored as part of a cache entry and <em class="bcp14">MUST</em> be transmitted in any response formed from a cache entry.</li><li>Hop-by-hop headers, which are meaningful only for a single transport-level connection, and are not stored by caches or forwarded by proxies.</li></ul><p id="rfc.section.2.5.1.p
 .2">The following HTTP/1.1 headers are hop-by-hop headers: </p><ul><li>Connection</li><li>Keep-Alive</li><li>Proxy-Authenticate</li><li>Proxy-Authorization</li><li>TE</li><li>Trailers</li><li>Transfer-Encoding</li><li>Upgrade</li></ul><p id="rfc.section.2.5.1.p.3">All other headers defined by HTTP/1.1 are end-to-end headers.</p><p id="rfc.section.2.5.1.p.4">Other hop-by-hop headers <em class="bcp14">MUST</em> be listed in a Connection header, ([Part 1]) to be introduced into HTTP/1.1 (or later).</p><h3 id="rfc.section.2.5.2"><a href="#rfc.section.2.5.2">2.5.2</a>&nbsp;<a id="non-modifiable.headers" href="#non-modifiable.headers">Non-modifiable Headers</a></h3><p id="rfc.section.2.5.2.p.1">Some features of the HTTP/1.1 protocol, such as Digest Authentication, depend on the value of certain end-to-end headers. A transparent proxy <em class="bcp14">SHOULD NOT</em> modify an end-to-end header unless the definition of that header requires or specifically allows that.</p><p id="rf
 c.section.2.5.2.p.2">A transparent proxy <em class="bcp14">MUST NOT</em> modify any of the following fields in a request or response, and it <em class="bcp14">MUST NOT</em> add any of these fields if not already present: </p><ul><li>Content-Location</li><li>Content-MD5</li><li>ETag</li><li>Last-Modified</li></ul><p id="rfc.section.2.5.2.p.3">A transparent proxy <em class="bcp14">MUST NOT</em> modify any of the following fields in a response: </p><ul><li>Expires</li></ul><p id="rfc.section.2.5.2.p.4">but it <em class="bcp14">MAY</em> add any of these fields if not already present. If an Expires header is added, it <em class="bcp14">MUST</em> be given a field-value identical to that of the Date header in that response.</p><p id="rfc.section.2.5.2.p.5">A proxy <em class="bcp14">MUST NOT</em> modify or add any of the following fields in a message that contains the no-transform cache-control directive, or in any request: </p><ul><li>Content-Encoding</li><li>Content-Range</li><li>
 Content-Type</li></ul><p id="rfc.section.2.5.2.p.6">A non-transparent proxy <em class="bcp14">MAY</em> modify or add these fields to a message that does not include no-transform, but if it does so, it <em class="bcp14">MUST</em> add a Warning 214 (Transformation applied) if one does not already appear in the message (see <a href="#header.warning" id="rfc.xref.header.warning.4" title="Warning">Section&nbsp;3.6</a>). </p><dl class="empty"><dd>Warning: unnecessary modification of end-to-end headers might cause authentication failures if stronger authentication mechanisms are introduced in later versions of HTTP. Such authentication mechanisms <em class="bcp14">MAY</em> rely on the values of header fields not listed here.</dd></dl><p id="rfc.section.2.5.2.p.7">The Content-Length field of a request or response is added or deleted according to the rules in [Part 1]. A transparent proxy <em class="bcp14">MUST</em> preserve the entity-length ([Part 3]) of the entity-body, although i
 t <em class="bcp14">MAY</em> change the transfer-length ([Part 1]).</p><h3 id="rfc.section.2.5.3"><a href="#rfc.section.2.5.3">2.5.3</a>&nbsp;<a id="combining.headers" href="#combining.headers">Combining Headers</a></h3><p id="rfc.section.2.5.3.p.1">When a cache makes a validating request to a server, and the server provides a 304 (Not Modified) response or a 206 (Partial Content) response, the cache then constructs a response to send to the requesting client.</p><p id="rfc.section.2.5.3.p.2">If the status code is 304 (Not Modified), the cache uses the entity-body stored in the cache entry as the entity-body of this outgoing response. If the status code is 206 (Partial Content) and the ETag or Last-Modified headers match exactly, the cache <em class="bcp14">MAY</em> combine the contents stored in the cache entry with the new contents received in the response and use the result as the entity-body of this outgoing response, (see [Part 5]).</p><p id="rfc.section.2.5.3.p.3">The 
 end-to-end headers stored in the cache entry are used for the constructed response, except that </p><ul><li>any stored Warning headers with warn-code 1xx (see <a href="#header.warning" id="rfc.xref.header.warning.5" title="Warning">Section&nbsp;3.6</a>) <em class="bcp14">MUST</em> be deleted from the cache entry and the forwarded response.</li><li>any stored Warning headers with warn-code 2xx <em class="bcp14">MUST</em> be retained in the cache entry and the forwarded response.</li><li>any end-to-end headers provided in the 304 or 206 response <em class="bcp14">MUST</em> replace the corresponding headers from the cache entry.</li></ul><p id="rfc.section.2.5.3.p.4">Unless the cache decides to remove the cache entry, it <em class="bcp14">MUST</em> also replace the end-to-end headers stored with the cache entry with corresponding headers received in the incoming response, except for Warning headers as described immediately above. If a header field-name in the incoming response 
 matches more than one header in the cache entry, all such old headers <em class="bcp14">MUST</em> be replaced.</p><p id="rfc.section.2.5.3.p.5">In other words, the set of end-to-end headers received in the incoming response overrides all corresponding end-to-end headers stored with the cache entry (except for stored Warning headers with warn-code 1xx, which are deleted even if not overridden). </p><dl class="empty"><dd> <b>Note:</b> this rule allows an origin server to use a 304 (Not Modified) or a 206 (Partial Content) response to update any header associated with a previous response for the same entity or sub-ranges thereof, although it might not always be meaningful or correct to do so. This rule does not allow an origin server to use a 304 (Not Modified) or a 206 (Partial Content) response to entirely delete a header that it had provided with a previous response.</dd></dl><h2 id="rfc.section.2.6"><a href="#rfc.section.2.6">2.6</a>&nbsp;<a id="caching.negotiated.responses
 " href="#caching.negotiated.responses">Caching Negotiated Responses</a></h2><p id="rfc.section.2.6.p.1">Use of server-driven content negotiation ([Part 3]), as indicated by the presence of a Vary header field in a response, alters the conditions and procedure by which a cache can use the response for subsequent requests. See <a href="#header.vary" id="rfc.xref.header.vary.1" title="Vary">Section&nbsp;3.5</a> for use of the Vary header field by servers.</p><p id="rfc.section.2.6.p.2">A server <em class="bcp14">SHOULD</em> use the Vary header field to inform a cache of what request-header fields were used to select among multiple representations of a cacheable response subject to server-driven negotiation. The set of header fields named by the Vary field value is known as the "selecting" request-headers.</p><p id="rfc.section.2.6.p.3">When the cache receives a subsequent request whose Request-URI specifies one or more cache entries including a Vary header field, the cache <em 
 class="bcp14">MUST NOT</em> use such a cache entry to construct a response to the new request unless all of the selecting request-headers present in the new request match the corresponding stored request-headers in the original request.</p><p id="rfc.section.2.6.p.4">The selecting request-headers from two requests are defined to match if and only if the selecting request-headers in the first request can be transformed to the selecting request-headers in the second request by adding or removing linear white space (LWS) at places where this is allowed by the corresponding BNF, and/or combining multiple message-header fields with the same field name following the rules about message headers in [Part 1].</p><p id="rfc.section.2.6.p.5">A Vary header field-value of "*" always fails to match and subsequent requests on that resource can only be properly interpreted by the origin server.</p><p id="rfc.section.2.6.p.6">If the selecting request header fields for the cached entry do not
  match the selecting request header fields of the new request, then the cache <em class="bcp14">MUST NOT</em> use a cached entry to satisfy the request unless it first relays the new request to the origin server in a conditional request and the server responds with 304 (Not Modified), including an entity tag or Content-Location that indicates the entity to be used.</p><p id="rfc.section.2.6.p.7">If an entity tag was assigned to a cached representation, the forwarded request <em class="bcp14">SHOULD</em> be conditional and include the entity tags in an If-None-Match header field from all its cache entries for the resource. This conveys to the server the set of entities currently held by the cache, so that if any one of these entities matches the requested entity, the server can use the ETag header field in its 304 (Not Modified) response to tell the cache which entry is appropriate. If the entity-tag of the new response matches that of an existing entry, the new response <em 
 class="bcp14">SHOULD</em> be used to update the header fields of the existing entry, and the result <em class="bcp14">MUST</em> be returned to the client.</p><p id="rfc.section.2.6.p.8">If any of the existing cache entries contains only partial content for the associated entity, its entity-tag <em class="bcp14">SHOULD NOT</em> be included in the If-None-Match header field unless the request is for a range that would be fully satisfied by that entry.</p><p id="rfc.section.2.6.p.9">If a cache receives a successful response whose Content-Location field matches that of an existing cache entry for the same Request-URI, whose entity-tag differs from that of the existing entry, and whose Date is more recent than that of the existing entry, the existing entry <em class="bcp14">SHOULD NOT</em> be returned in response to future requests and <em class="bcp14">SHOULD</em> be deleted from the cache.</p><h2 id="rfc.section.2.7"><a href="#rfc.section.2.7">2.7</a>&nbsp;<a id="shared.and.non
 -shared.caches" href="#shared.and.non-shared.caches">Shared and Non-Shared Caches</a></h2><p id="rfc.section.2.7.p.1">For reasons of security and privacy, it is necessary to make a distinction between "shared" and "non-shared" caches. A non-shared cache is one that is accessible only to a single user. Accessibility in this case <em class="bcp14">SHOULD</em> be enforced by appropriate security mechanisms. All other caches are considered to be "shared." Other sections of this specification place certain constraints on the operation of shared caches in order to prevent loss of privacy or failure of access controls.</p><h2 id="rfc.section.2.8"><a href="#rfc.section.2.8">2.8</a>&nbsp;<a id="errors.or.incomplete.response.cache.behavior" href="#errors.or.incomplete.response.cache.behavior">Errors or Incomplete Response Cache Behavior</a></h2><p id="rfc.section.2.8.p.1">A cache that receives an incomplete response (for example, with fewer bytes of data than specified in a Content-Le
 ngth header) <em class="bcp14">MAY</em> store the response. However, the cache <em class="bcp14">MUST</em> treat this as a partial response. Partial responses <em class="bcp14">MAY</em> be combined as described in [Part 5]; the result might be a full response or might still be partial. A cache <em class="bcp14">MUST NOT</em> return a partial response to a client without explicitly marking it as such, using the 206 (Partial Content) status code. A cache <em class="bcp14">MUST NOT</em> return a partial response using a status code of 200 (OK).</p><p id="rfc.section.2.8.p.2">If a cache receives a 5xx response while attempting to revalidate an entry, it <em class="bcp14">MAY</em> either forward this response to the requesting client, or act as if the server failed to respond. In the latter case, it <em class="bcp14">MAY</em> return a previously received response unless the cached entry includes the "must-revalidate" cache-control directive (see <a href="#header.cache-control" id
 ="rfc.xref.header.cache-control.8" title="Cache-Control">Section&nbsp;3.2</a>).</p><h2 id="rfc.section.2.9"><a href="#rfc.section.2.9">2.9</a>&nbsp;Side Effects of GET and HEAD</h2><p id="rfc.section.2.9.p.1">Unless the origin server explicitly prohibits the caching of their responses, the application of GET and HEAD methods to any resources <em class="bcp14">SHOULD NOT</em> have side effects that would lead to erroneous behavior if these responses are taken from a cache. They <em class="bcp14">MAY</em> still have side effects, but a cache is not required to consider such side effects in its caching decisions. Caches are always expected to observe an origin server's explicit restrictions on caching.</p><p id="rfc.section.2.9.p.2">We note one exception to this rule: since some applications have traditionally used GETs and HEADs with query URLs (those containing a "?" in the rel_path part) to perform operations with significant side effects, caches <em class="bcp14">MUST NOT</
 em> treat responses to such URIs as fresh unless the server provides an explicit expiration time. This specifically means that responses from HTTP/1.0 servers for such URIs <em class="bcp14">SHOULD NOT</em> be taken from a cache. See [Part 2] for related information.</p><h2 id="rfc.section.2.10"><a href="#rfc.section.2.10">2.10</a>&nbsp;<a id="invalidation.after.updates.or.deletions" href="#invalidation.after.updates.or.deletions">Invalidation After Updates or Deletions</a></h2><p id="rfc.section.2.10.p.1">The effect of certain methods performed on a resource at the origin server might cause one or more existing cache entries to become non-transparently invalid. That is, although they might continue to be "fresh," they do not accurately reflect what the origin server would return for a new request on that resource.</p><p id="rfc.section.2.10.p.2">There is no way for the HTTP protocol to guarantee that all such cache entries are marked invalid. For example, the request that c
 aused the change at the origin server might not have gone through the proxy where a cache entry is stored. However, several rules help reduce the likelihood of erroneous behavior.</p><p id="rfc.section.2.10.p.3">In this section, the phrase "invalidate an entity" means that the cache will either remove all instances of that entity from its storage, or will mark these as "invalid" and in need of a mandatory revalidation before they can be returned in response to a subsequent request.</p><p id="rfc.section.2.10.p.4">Some HTTP methods <em class="bcp14">MUST</em> cause a cache to invalidate an entity. This is either the entity referred to by the Request-URI, or by the Location or Content-Location headers (if present). These methods are: </p><ul><li>PUT</li><li>DELETE</li><li>POST</li></ul><p id="rfc.section.2.10.p.5">In order to prevent denial of service attacks, an invalidation based on the URI in a Location or Content-Location header <em class="bcp14">MUST</em> only be performe
 d if the host part is the same as in the Request-URI.</p><p id="rfc.section.2.10.p.6">A cache that passes through requests for methods it does not understand <em class="bcp14">SHOULD</em> invalidate any entities referred to by the Request-URI.</p><h2 id="rfc.section.2.11"><a href="#rfc.section.2.11">2.11</a>&nbsp;<a id="write-through.mandatory" href="#write-through.mandatory">Write-Through Mandatory</a></h2><p id="rfc.section.2.11.p.1">All methods that might be expected to cause modifications to the origin server's resources <em class="bcp14">MUST</em> be written through to the origin server. This currently includes all methods except for GET and HEAD. A cache <em class="bcp14">MUST NOT</em> reply to such a request from a client before having transmitted the request to the inbound server, and having received a corresponding response from the inbound server. This does not prevent a proxy cache from sending a 100 (Continue) response before the inbound server has sent its final
  reply.</p><p id="rfc.section.2.11.p.2">The alternative (known as "write-back" or "copy-back" caching) is not allowed in HTTP/1.1, due to the difficulty of providing consistent updates and the problems arising from server, cache, or network failure prior to write-back.</p><h2 id="rfc.section.2.12"><a href="#rfc.section.2.12">2.12</a>&nbsp;<a id="cache.replacement" href="#cache.replacement">Cache Replacement</a></h2><p id="rfc.section.2.12.p.1">If a new cacheable (see sections <a href="#what.may.be.stored.by.caches" title="What May be Stored by Caches">3.2.2</a>, <a href="#disambiguating.expiration.values" title="Disambiguating Expiration Values">2.2.5</a>, <a href="#disambiguating.multiple.responses" title="Disambiguating Multiple Responses">2.2.6</a> and <a href="#errors.or.incomplete.response.cache.behavior" title="Errors or Incomplete Response Cache Behavior">2.8</a>) response is received from a resource while any existing responses for the same resource are cached, the c
 ache <em class="bcp14">SHOULD</em> use the new response to reply to the current request. It <em class="bcp14">MAY</em> insert it into cache storage and <em class="bcp14">MAY</em>, if it meets all other requirements, use it to respond to any future requests that would previously have caused the old response to be returned. If it inserts the new response into cache storage the rules in <a href="#combining.headers" title="Combining Headers">Section&nbsp;2.5.3</a> apply. </p><dl class="empty"><dd> <b>Note:</b> a new response that has an older Date header value than existing cached responses is not cacheable.</dd></dl><h2 id="rfc.section.2.13"><a href="#rfc.section.2.13">2.13</a>&nbsp;<a id="history.lists" href="#history.lists">History Lists</a></h2><p id="rfc.section.2.13.p.1">User agents often have history mechanisms, such as "Back" buttons and history lists, which can be used to redisplay an entity retrieved earlier in a session.</p><p id="rfc.section.2.13.p.2">History mechani
 sms and caches are different. In particular history mechanisms <em class="bcp14">SHOULD NOT</em> try to show a semantically transparent view of the current state of a resource. Rather, a history mechanism is meant to show exactly what the user saw at the time when the resource was retrieved.</p><p id="rfc.section.2.13.p.3">By default, an expiration time does not apply to history mechanisms. If the entity is still in storage, a history mechanism <em class="bcp14">SHOULD</em> display it even if the entity has expired, unless the user has specifically configured the agent to refresh expired history documents.</p><p id="rfc.section.2.13.p.4">This is not to be construed to prohibit the history mechanism from telling the user that a view might be stale. </p><dl class="empty"><dd> <b>Note:</b> if history list mechanisms unnecessarily prevent users from viewing stale resources, this will tend to force service authors to avoid using HTTP expiration controls and cache controls when th
 ey would otherwise like to. Service authors may consider it important that users not be presented with error messages or warning messages when they use navigation controls (such as BACK) to view previously fetched resources. Even though sometimes such resources ought not to cached, or ought to expire quickly, user interface considerations may force service authors to resort to other means of preventing caching (e.g. "once-only" URLs) in order not to suffer the effects of improperly functioning history mechanisms.</dd></dl><h1 id="rfc.section.3"><a href="#rfc.section.3">3.</a>&nbsp;Header Field Definitions</h1><p id="rfc.section.3.p.1">This section defines the syntax and semantics of all standard HTTP/1.1 header fields. For entity-header fields, both sender and recipient refer to either the client or the server, depending on who sends and who receives the entity.</p><div id="rfc.iref.a.2"></div><div id="rfc.iref.h.2"></div><h2 id="rfc.section.3.1"><a href="#rfc.section.3.1">3
 .1</a>&nbsp;<a id="header.age" href="#header.age">Age</a></h2><p id="rfc.section.3.1.p.1">The Age response-header field conveys the sender's estimate of the amount of time since the response (or its revalidation) was generated at the origin server. A cached response is "fresh" if its age does not exceed its freshness lifetime. Age values are calculated as specified in <a href="#age.calculations" title="Age Calculations">Section&nbsp;2.2.3</a>.</p><div id="rfc.figure.u.10"></div><pre class="inline"><span id="rfc.iref.g.2"></span><span id="rfc.iref.g.3"></span>        Age = "Age" ":" age-value
+        age-value = delta-seconds
+</pre><p id="rfc.section.3.1.p.3">Age values are non-negative decimal integers, representing time in seconds.</p><p id="rfc.section.3.1.p.4">If a cache receives a value larger than the largest positive integer it can represent, or if any of its age calculations overflows, it <em class="bcp14">MUST</em> transmit an Age header with a value of 2147483648 (2^31). An HTTP/1.1 server that includes a cache <em class="bcp14">MUST</em> include an Age header field in every response generated from its own cache. Caches <em class="bcp14">SHOULD</em> use an arithmetic type of at least 31 bits of range.</p><div id="rfc.iref.c.3"></div><div id="rfc.iref.h.3"></div><h2 id="rfc.section.3.2"><a href="#rfc.section.3.2">3.2</a>&nbsp;<a id="header.cache-control" href="#header.cache-control">Cache-Control</a></h2><p id="rfc.section.3.2.p.1">The Cache-Control general-header field is used to specify directives that <em class="bcp14">MUST</em> be obeyed by all caching mechanisms along the request/re
 sponse chain. The directives specify behavior intended to prevent caches from adversely interfering with the request or response. These directives typically override the default caching algorithms. 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. </p><dl class="empty"><dd>Note that HTTP/1.0 caches might not implement Cache-Control and might only implement Pragma: no-cache (see <a href="#header.pragma" id="rfc.xref.header.pragma.1" title="Pragma">Section&nbsp;3.4</a>).</dd></dl><p id="rfc.section.3.2.p.2">Cache directives <em class="bcp14">MUST</em> be passed through by a proxy or gateway application, 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 specify a cache-directive for a specific cache.</p><div id="rfc.figure.u.11"></div><pre class="inline"><s
 pan id="rfc.iref.g.4"></span><span id="rfc.iref.g.5"></span><span id="rfc.iref.g.6"></span><span id="rfc.iref.g.7"></span><span id="rfc.iref.g.8"></span>   Cache-Control   = "Cache-Control" ":" 1#cache-directive
+
+   cache-directive = cache-request-directive
+        | cache-response-directive
+
+   cache-request-directive =
+          "no-cache"                          ; <a href="#what.is.cacheable" title="What is Cacheable">Section&nbsp;3.2.1</a>
+        | "no-store"                          ; <a href="#what.may.be.stored.by.caches" title="What May be Stored by Caches">Section&nbsp;3.2.2</a>
+        | "max-age" "=" delta-seconds         ; <a href="#modifications.of.the.basic.expiration.mechanism" title="Modifications of the Basic Expiration Mechanism">Section&nbsp;3.2.3</a>, <a href="#cache.revalidation.and.reload.controls" title="Cache Revalidation and Reload Controls">3.2.4</a>
+        | "max-stale" [ "=" delta-seconds ]   ; <a href="#modifications.of.the.basic.expiration.mechanism" title="Modifications of the Basic Expiration Mechanism">Section&nbsp;3.2.3</a>
+        | "min-fresh" "=" delta-seconds       ; <a href="#modifications.of.the.basic.expiration.mechanism" title="Modifications of the Basic Expiration Mechanism">Section&nbsp;3.2.3</a>
+        | "no-transform"                      ; <a href="#no-transform.directive" title="No-Transform Directive">Section&nbsp;3.2.5</a>
+        | "only-if-cached"                    ; <a href="#cache.revalidation.and.reload.controls" title="Cache Revalidation and Reload Controls">Section&nbsp;3.2.4</a>
+        | cache-extension                     ; <a href="#cache.control.extensions" title="Cache Control Extensions">Section&nbsp;3.2.6</a>
+
+    cache-response-directive =
+          "public"                               ; <a href="#what.is.cacheable" title="What is Cacheable">Section&nbsp;3.2.1</a>
+        | "private" [ "=" &lt;"&gt; 1#field-name &lt;"&gt; ] ; <a href="#what.is.cacheable" title="What is Cacheable">Section&nbsp;3.2.1</a>
+        | "no-cache" [ "=" &lt;"&gt; 1#field-name &lt;"&gt; ]; <a href="#what.is.cacheable" title="What is Cacheable">Section&nbsp;3.2.1</a>
+        | "no-store"                             ; <a href="#what.may.be.stored.by.caches" title="What May be Stored by Caches">Section&nbsp;3.2.2</a>
+        | "no-transform"                         ; <a href="#no-transform.directive" title="No-Transform Directive">Section&nbsp;3.2.5</a>
+        | "must-revalidate"                      ; <a href="#cache.revalidation.and.reload.controls" title="Cache Revalidation and Reload Controls">Section&nbsp;3.2.4</a>
+        | "proxy-revalidate"                     ; <a href="#cache.revalidation.and.reload.controls" title="Cache Revalidation and Reload Controls">Section&nbsp;3.2.4</a>
+        | "max-age" "=" delta-seconds            ; <a href="#modifications.of.the.basic.expiration.mechanism" title="Modifications of the Basic Expiration Mechanism">Section&nbsp;3.2.3</a>
+        | "s-maxage" "=" delta-seconds           ; <a href="#modifications.of.the.basic.expiration.mechanism" title="Modifications of the Basic Expiration Mechanism">Section&nbsp;3.2.3</a>
+        | cache-extension                        ; <a href="#cache.control.extensions" title="Cache Control Extensions">Section&nbsp;3.2.6</a>
+
+   cache-extension = token [ "=" ( token | quoted-string ) ]

[... 21 lines stripped ...]
Propchange: labs/webarch/trunk/http/draft-fielding-http/p6-cache.html
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org