Changeset 2234 for draft-ietf-httpbis/latest/p6-cache.html
- Timestamp:
- 07/05/13 06:14:22 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
draft-ietf-httpbis/latest/p6-cache.html
r2232 r2234 452 452 } 453 453 @bottom-center { 454 content: "Expires November 2, 2013";454 content: "Expires November 8, 2013"; 455 455 } 456 456 @bottom-right { … … 492 492 <link href="p5-range.html" rel="prev"> 493 493 <link href="p7-auth.html" rel="next"> 494 <meta name="generator" content="http://greenbytes.de/tech/webdav/rfc2629.xslt, Revision 1.594, 2013/04/30 16:11:28, XSLT vendor: SAXON 8.9from Saxonica http://www.saxonica.com/">494 <meta name="generator" content="http://greenbytes.de/tech/webdav/rfc2629.xslt, Revision 1.594, 2013/04/30 16:11:28, XSLT vendor: SAXON 9.1.0.8 from Saxonica http://www.saxonica.com/"> 495 495 <link rel="schema.dct" href="http://purl.org/dc/terms/"> 496 496 <meta name="dct.creator" content="Fielding, R."> … … 498 498 <meta name="dct.creator" content="Reschke, J. F."> 499 499 <meta name="dct.identifier" content="urn:ietf:id:draft-ietf-httpbis-p6-cache-latest"> 500 <meta name="dct.issued" scheme="ISO8601" content="2013-05-0 1">500 <meta name="dct.issued" scheme="ISO8601" content="2013-05-07"> 501 501 <meta name="dct.replaces" content="urn:ietf:rfc:2616"> 502 502 <meta name="dct.abstract" content="The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypertext information systems. This document defines requirements on HTTP caches and the associated header fields that control cache behavior or indicate cacheable response messages."> … … 524 524 </tr> 525 525 <tr> 526 <td class="left">Expires: November 2, 2013</td>526 <td class="left">Expires: November 8, 2013</td> 527 527 <td class="right">J. Reschke, Editor</td> 528 528 </tr> … … 533 533 <tr> 534 534 <td class="left"></td> 535 <td class="right">May 1, 2013</td>535 <td class="right">May 7, 2013</td> 536 536 </tr> 537 537 </tbody> … … 559 559 in progress”. 560 560 </p> 561 <p>This Internet-Draft will expire on November 2, 2013.</p>561 <p>This Internet-Draft will expire on November 8, 2013.</p> 562 562 <h1><a id="rfc.copyrightnotice" href="#rfc.copyrightnotice">Copyright Notice</a></h1> 563 563 <p>Copyright © 2013 IETF Trust and the persons identified as the document authors. All rights reserved.</p> … … 578 578 <ul class="toc"> 579 579 <li><a href="#rfc.section.1">1.</a> <a href="#caching">Introduction</a><ul> 580 <li><a href="#rfc.section.1.1">1.1</a> <a href="#intro.purpose">Purpose</a></li> 581 <li><a href="#rfc.section.1.2">1.2</a> <a href="#intro.terminology">Terminology</a></li> 582 <li><a href="#rfc.section.1.3">1.3</a> <a href="#conformance">Conformance and Error Handling</a></li> 583 <li><a href="#rfc.section.1.4">1.4</a> <a href="#notation">Syntax Notation</a><ul> 584 <li><a href="#rfc.section.1.4.1">1.4.1</a> <a href="#delta-seconds">Delta Seconds</a></li> 580 <li><a href="#rfc.section.1.1">1.1</a> <a href="#intro.terminology">Terminology</a></li> 581 <li><a href="#rfc.section.1.2">1.2</a> <a href="#conformance">Conformance and Error Handling</a></li> 582 <li><a href="#rfc.section.1.3">1.3</a> <a href="#notation">Syntax Notation</a><ul> 583 <li><a href="#rfc.section.1.3.1">1.3.1</a> <a href="#delta-seconds">Delta Seconds</a></li> 585 584 </ul> 586 585 </li> … … 594 593 </li> 595 594 <li><a href="#rfc.section.4">4.</a> <a href="#constructing.responses.from.caches">Constructing Responses from Caches</a><ul> 596 <li><a href="#rfc.section.4.1">4.1</a> <a href="#expiration.model">Freshness Model</a><ul>595 <li><a href="#rfc.section.4.1">4.1</a> <a href="#expiration.model">Freshness</a><ul> 597 596 <li><a href="#rfc.section.4.1.1">4.1.1</a> <a href="#calculating.freshness.lifetime">Calculating Freshness Lifetime</a></li> 598 597 <li><a href="#rfc.section.4.1.2">4.1.2</a> <a href="#heuristic.freshness">Calculating Heuristic Freshness</a></li> … … 601 600 </ul> 602 601 </li> 603 <li><a href="#rfc.section.4.2">4.2</a> <a href="#validation.model">Validation Model</a><ul>602 <li><a href="#rfc.section.4.2">4.2</a> <a href="#validation.model">Validation</a><ul> 604 603 <li><a href="#rfc.section.4.2.1">4.2.1</a> <a href="#freshening.responses">Freshening Responses with 304 Not Modified</a></li> 605 604 </ul> … … 686 685 </p> 687 686 <div id="rfc.iref.c.1"></div> 688 <h2 id="rfc.section.1.1"><a href="#rfc.section.1.1">1.1</a> <a id="intro.purpose" href="#intro.purpose">Purpose</a></h2> 689 <p id="rfc.section.1.1.p.1">An HTTP <dfn>cache</dfn> is a local store of response messages and the subsystem that controls its message storage, retrieval, and deletion. A cache 690 stores cacheable responses in order to reduce the response time and network bandwidth consumption on future, equivalent requests. 691 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. 692 </p> 693 <p id="rfc.section.1.1.p.2">The goal of caching in HTTP/1.1 is to significantly improve performance by reusing a prior response message to satisfy a current 694 request. A stored response is considered "fresh", as defined in <a href="#expiration.model" title="Freshness Model">Section 4.1</a>, if the response can be reused without "validation" (checking with the origin server to see if the cached response remains 695 valid for this request). A fresh cache response can therefore reduce both latency and network transfers each time it is reused. 696 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 Model">Section 4.2</a>) or if the origin is unavailable. 697 </p> 698 <h2 id="rfc.section.1.2"><a href="#rfc.section.1.2">1.2</a> <a id="intro.terminology" href="#intro.terminology">Terminology</a></h2> 699 <p id="rfc.section.1.2.p.1">This specification uses a number of terms to refer to the roles played by participants in, and objects of, HTTP caching.</p> 700 <p id="rfc.section.1.2.p.2"> <span id="rfc.iref.c.2"></span> <dfn>cache</dfn> 687 <p id="rfc.section.1.p.2">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. 688 A cache stores cacheable responses in order to reduce the response time and network bandwidth consumption on future, equivalent 689 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. 690 </p> 691 <p id="rfc.section.1.p.3">The goal of caching in HTTP/1.1 is to significantly improve performance by reusing a prior response message to satisfy a current 692 request. A stored response is considered "fresh", as defined in <a href="#expiration.model" title="Freshness">Section 4.1</a>, if the response can be reused without "validation" (checking with the origin server to see if the cached response remains 693 valid for this request). A fresh response can therefore reduce both latency and network overhead each time it is reused. When 694 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 4.2</a>) or if the origin is unavailable (xref target="serving.stale.responses" />). 695 </p> 696 <h2 id="rfc.section.1.1"><a href="#rfc.section.1.1">1.1</a> <a id="intro.terminology" href="#intro.terminology">Terminology</a></h2> 697 <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, HTTP caching.</p> 698 <p id="rfc.section.1.1.p.2"> <span id="rfc.iref.c.2"></span> <dfn>cache</dfn> 701 699 </p> 702 700 <ul class="empty"> … … 706 704 </ul> 707 705 <div id="shared.and.non-shared.caches"> 708 <p id="rfc.section.1. 2.p.3"> <span id="rfc.iref.s.1"></span> <dfn>shared cache</dfn>706 <p id="rfc.section.1.1.p.3"> <span id="rfc.iref.s.1"></span> <dfn>shared cache</dfn> 709 707 </p> 710 708 <ul class="empty"> … … 712 710 </ul> 713 711 </div> 714 <p id="rfc.section.1. 2.p.4"> <span id="rfc.iref.p.1"></span> <dfn>private cache</dfn>712 <p id="rfc.section.1.1.p.4"> <span id="rfc.iref.p.1"></span> <dfn>private cache</dfn> 715 713 </p> 716 714 <ul class="empty"> 717 715 <li>A cache that is dedicated to a single user.</li> 718 716 </ul> 719 <p id="rfc.section.1. 2.p.5"> <span id="rfc.iref.c.3"></span> <dfn>cacheable</dfn>717 <p id="rfc.section.1.1.p.5"> <span id="rfc.iref.c.3"></span> <dfn>cacheable</dfn> 720 718 </p> 721 719 <ul class="empty"> … … 725 723 </li> 726 724 </ul> 727 <p id="rfc.section.1. 2.p.6"> <span id="rfc.iref.e.1"></span> <dfn>explicit expiration time</dfn>725 <p id="rfc.section.1.1.p.6"> <span id="rfc.iref.e.1"></span> <dfn>explicit expiration time</dfn> 728 726 </p> 729 727 <ul class="empty"> 730 728 <li>The time at which the origin server intends that a stored response no longer be used by a cache without further validation.</li> 731 729 </ul> 732 <p id="rfc.section.1. 2.p.7"> <span id="rfc.iref.h.1"></span> <dfn>heuristic expiration time</dfn>730 <p id="rfc.section.1.1.p.7"> <span id="rfc.iref.h.1"></span> <dfn>heuristic expiration time</dfn> 733 731 </p> 734 732 <ul class="empty"> 735 733 <li>An expiration time assigned by a cache when no explicit expiration time is available.</li> 736 734 </ul> 737 <p id="rfc.section.1. 2.p.8"> <span id="rfc.iref.a.1"></span> <dfn>age</dfn>738 </p> 739 <ul class="empty"> 740 <li>The age of a response is the time since itwas sent by, or successfully validated with, the origin server.</li>741 </ul> 742 <p id="rfc.section.1. 2.p.9"> <span id="rfc.iref.f.1"></span> <dfn>first-hand</dfn>735 <p id="rfc.section.1.1.p.8"> <span id="rfc.iref.a.1"></span> <dfn>age</dfn> 736 </p> 737 <ul class="empty"> 738 <li>The time since a response was sent by, or successfully validated with, the origin server.</li> 739 </ul> 740 <p id="rfc.section.1.1.p.9"> <span id="rfc.iref.f.1"></span> <dfn>first-hand</dfn> 743 741 </p> 744 742 <ul class="empty"> 745 743 <li>A response is first-hand if the freshness model is not in use; i.e., its age is 0.</li> 746 744 </ul> 747 <p id="rfc.section.1. 2.p.10"> <span id="rfc.iref.f.2"></span> <dfn>freshness lifetime</dfn>748 </p> 749 <ul class="empty"> 750 <li>The length of time between the generation of a response and its expiration time .</li>751 </ul> 752 <p id="rfc.section.1. 2.p.11"> <span id="rfc.iref.f.3"></span> <dfn>fresh</dfn>745 <p id="rfc.section.1.1.p.10"> <span id="rfc.iref.f.2"></span> <dfn>freshness lifetime</dfn> 746 </p> 747 <ul class="empty"> 748 <li>The length of time between the generation of a response and its expiration time (either explicit or heuristic).</li> 749 </ul> 750 <p id="rfc.section.1.1.p.11"> <span id="rfc.iref.f.3"></span> <dfn>fresh</dfn> 753 751 </p> 754 752 <ul class="empty"> 755 753 <li>A response is fresh if its age has not yet exceeded its freshness lifetime.</li> 756 754 </ul> 757 <p id="rfc.section.1.2.p.12"> <span id="rfc.iref.s.2"></span> <dfn>stale</dfn> 758 </p> 759 <ul class="empty"> 760 <li>A response is stale if its age has passed its freshness lifetime (either explicit or heuristic).</li> 761 </ul> 762 <p id="rfc.section.1.2.p.13"> <span id="rfc.iref.v.1"></span> <dfn>validator</dfn> 763 </p> 764 <ul class="empty"> 765 <li>A protocol element (e.g., an entity-tag or a <a href="p4-conditional.html#header.last-modified" class="smpl">Last-Modified</a> time) that is used to find out whether a stored response is an equivalent copy of a representation. See <a href="p4-conditional.html#weak.and.strong.validators" title="Weak versus Strong">Section 2.1</a> of <a href="#Part4" id="rfc.xref.Part4.1"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[Part4]</cite></a>. 766 </li> 767 </ul> 768 <p id="rfc.section.1.2.p.14"> <span id="rfc.iref.s.3"></span> <span id="rfc.iref.v.2"></span> <dfn>strong validator</dfn> 769 </p> 770 <ul class="empty"> 771 <li>A validator that is defined by the origin server such that its current value will change if the representation data changes; 772 i.e., an entity-tag that is not marked as weak (<a href="p4-conditional.html#header.etag" title="ETag">Section 2.3</a> of <a href="#Part4" id="rfc.xref.Part4.2"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[Part4]</cite></a>) or, if no entity-tag is provided, a <a href="p4-conditional.html#header.last-modified" class="smpl">Last-Modified</a> value that is strong in the sense defined by <a href="p4-conditional.html#lastmod.comparison" title="Comparison">Section 2.2.2</a> of <a href="#Part4" id="rfc.xref.Part4.3"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[Part4]</cite></a>. 773 </li> 774 </ul> 775 <h2 id="rfc.section.1.3"><a href="#rfc.section.1.3">1.3</a> <a id="conformance" href="#conformance">Conformance and Error Handling</a></h2> 776 <p id="rfc.section.1.3.p.1">The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" 755 <p id="rfc.section.1.1.p.12"> <span id="rfc.iref.s.2"></span> <dfn>stale</dfn> 756 </p> 757 <ul class="empty"> 758 <li>A response is stale if its age has passed its freshness lifetime.</li> 759 </ul> 760 <p id="rfc.section.1.1.p.13"> <span id="rfc.iref.v.1"></span> <dfn>validator</dfn> 761 </p> 762 <ul class="empty"> 763 <li>A protocol element (e.g., an entity-tag or a <a href="p4-conditional.html#header.last-modified" class="smpl">Last-Modified</a> time) that is used to find out whether a stored response is an equivalent copy of a representation. . 764 </li> 765 </ul> 766 <p id="rfc.section.1.1.p.14"> <span id="rfc.iref.s.3"></span> <span id="rfc.iref.v.2"></span> <dfn>strong validator</dfn> 767 </p> 768 <ul class="empty"> 769 <li>A validator that is defined by the origin server such that its current value will change if the representation data changes. 770 See <a href="p4-conditional.html#weak.and.strong.validators" title="Weak versus Strong">Section 2.1</a> of <a href="#Part4" id="rfc.xref.Part4.1"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[Part4]</cite></a></li> 771 </ul> 772 <h2 id="rfc.section.1.2"><a href="#rfc.section.1.2">1.2</a> <a id="conformance" href="#conformance">Conformance and Error Handling</a></h2> 773 <p id="rfc.section.1.2.p.1">The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" 777 774 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>. 778 775 </p> 779 <p id="rfc.section.1. 3.p.2">Conformance criteria and considerations regarding error handling are defined in <a href="p1-messaging.html#conformance" title="Conformance and Error Handling">Section 2.5</a> of <a href="#Part1" id="rfc.xref.Part1.1"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[Part1]</cite></a>.780 </p> 781 <h2 id="rfc.section.1. 4"><a href="#rfc.section.1.4">1.4</a> <a id="notation" href="#notation">Syntax Notation</a></h2>782 <p id="rfc.section.1. 4.p.1">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 the list rule extension defined in <a href="p1-messaging.html#notation" title="Syntax Notation">Section 1.2</a> of <a href="#Part1" id="rfc.xref.Part1.2"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[Part1]</cite></a>. <a href="#imported.abnf" title="Imported ABNF">Appendix B</a> describes rules imported from other documents. <a href="#collected.abnf" title="Collected ABNF">Appendix C</a> shows the collected ABNF with the list rule expanded.783 </p> 784 <h3 id="rfc.section.1. 4.1"><a href="#rfc.section.1.4.1">1.4.1</a> <a id="delta-seconds" href="#delta-seconds">Delta Seconds</a></h3>785 <p id="rfc.section.1. 4.1.p.1">The delta-seconds rule specifies a non-negative integer, representing time in seconds.</p>776 <p id="rfc.section.1.2.p.2">Conformance criteria and considerations regarding error handling are defined in <a href="p1-messaging.html#conformance" title="Conformance and Error Handling">Section 2.5</a> of <a href="#Part1" id="rfc.xref.Part1.1"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[Part1]</cite></a>. 777 </p> 778 <h2 id="rfc.section.1.3"><a href="#rfc.section.1.3">1.3</a> <a id="notation" href="#notation">Syntax Notation</a></h2> 779 <p id="rfc.section.1.3.p.1">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 the list rule extension defined in <a href="p1-messaging.html#notation" title="Syntax Notation">Section 1.2</a> of <a href="#Part1" id="rfc.xref.Part1.2"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing">[Part1]</cite></a>. <a href="#imported.abnf" title="Imported ABNF">Appendix B</a> describes rules imported from other documents. <a href="#collected.abnf" title="Collected ABNF">Appendix C</a> shows the collected ABNF with the list rule expanded. 780 </p> 781 <h3 id="rfc.section.1.3.1"><a href="#rfc.section.1.3.1">1.3.1</a> <a id="delta-seconds" href="#delta-seconds">Delta Seconds</a></h3> 782 <p id="rfc.section.1.3.1.p.1">The delta-seconds rule specifies a non-negative integer, representing time in seconds.</p> 786 783 <div id="rfc.figure.u.1"></div><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> 787 </pre><p id="rfc.section.1. 4.1.p.3">If an implementation receives a delta-seconds value larger than the largest positive integer it can represent, or if any of784 </pre><p id="rfc.section.1.3.1.p.3">If an implementation receives a delta-seconds value larger than the largest positive integer it can represent, or if any of 788 785 its subsequent calculations overflows, it <em class="bcp14">MUST</em> consider the value to be 2147483648 (2<sup>31</sup>). Recipients parsing a delta-seconds value <em class="bcp14">MUST</em> use an arithmetic type of at least 31 bits of range, and senders <em class="bcp14">MUST NOT</em> send delta-seconds with a value greater than 2147483648. 789 786 </p> … … 792 789 <h1 id="rfc.section.2"><a href="#rfc.section.2">2.</a> <a id="caching.overview" href="#caching.overview">Overview of Cache Operation</a></h1> 793 790 <p id="rfc.section.2.p.1">Proper cache operation preserves the semantics of HTTP transfers (<a href="#Part2" id="rfc.xref.Part2.1"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[Part2]</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, we assume that reusing the cached response is desirable and that such reuse is the default behavior when 794 no requirement or locally-desired configuration prevents it. Therefore, HTTP cache requirements are focused on preventing 795 a cache from either storing a non-reusable response or reusing a stored response inappropriately. 791 no requirement or local configuration prevents it. Therefore, HTTP cache requirements are focused on preventing a cache from 792 either storing a non-reusable response or reusing a stored response inappropriately, rather than mandating that caches always 793 store and reuse particular responses. 796 794 </p> 797 795 <p id="rfc.section.2.p.2">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 … … 799 797 use as a cache key. 800 798 </p> 801 <p id="rfc.section.2.p.3">The default<dfn>cache key</dfn> consists of the request method and target URI. However, since HTTP caches in common use today are typically limited to caching802 responses to GET, many implementations simply decline other methods and use only the URI as the key.799 <p id="rfc.section.2.p.3">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 800 responses to GET, many implementations simply decline other methods and use only the URI as the primary cache key. 803 801 </p> 804 802 <p id="rfc.section.2.p.4">If a request target is subject to content negotiation, its cache entry might consist of multiple stored responses, each differentiated … … 823 821 <li>contains a max-age response cache directive (see <a href="#cache-response-directive.max-age" title="max-age">Section 7.2.2.7</a>), or 824 822 </li> 825 <li>contains a s-maxage response cache directive and the cache is shared, or</li> 823 <li>contains a s-maxage response cache directive (see <a href="#cache-response-directive.s-maxage" title="s-maxage">Section 7.2.2.8</a>) and the cache is shared, or 824 </li> 826 825 <li>contains a Cache Control Extension (see <a href="#cache.control.extensions" title="Cache Control Extensions">Section 7.2.3</a>) that allows it to be cached, or 827 826 </li> … … 835 834 <p id="rfc.section.3.p.2">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 7.2.3</a>. 836 835 </p> 837 <p id="rfc.section.3.p.3">In this context, a cache has "understood" a request method or a response status code if it recognizes it and implements a ny838 cache-specificbehavior.839 </p> 840 <p id="rfc.section.3.p.4">Note that, in normal operation, manycaches will not store a response that has neither a cache validator nor an explicit expiration836 <p id="rfc.section.3.p.3">In this context, a cache has "understood" a request method or a response status code if it recognizes it and implements all 837 specified caching-related behavior. 838 </p> 839 <p id="rfc.section.3.p.4">Note that, in normal operation, some caches will not store a response that has neither a cache validator nor an explicit expiration 841 840 time, as such responses are not usually useful to store. However, caches are not prohibited from storing such responses. 842 841 </p> … … 859 858 </p> 860 859 <h1 id="rfc.section.4"><a href="#rfc.section.4">4.</a> <a id="constructing.responses.from.caches" href="#constructing.responses.from.caches">Constructing Responses from Caches</a></h1> 861 <p id="rfc.section.4.p.1"> For a presented request, a cache <em class="bcp14">MUST NOT</em> senda stored response, unless:860 <p id="rfc.section.4.p.1">When presented with a request, a cache <em class="bcp14">MUST NOT</em> reuse a stored response, unless: 862 861 </p> 863 862 <ul> … … 867 866 <li>selecting header fields nominated by the stored response (if any) match those presented (see <a href="#caching.negotiated.responses" title="Using Negotiated Responses">Section 4.3</a>), and 868 867 </li> 869 <li>the presented request does not contain the no-cache pragma (<a href="#header.pragma" id="rfc.xref.header.pragma.1" title="Pragma">Section 7.4</a>), nor the no-cache cache directive (<a href="#cache-request-directive" title="Request Cache-Control Directives">Section 7.2.1</a>), unless the stored response is successfully validated (<a href="#validation.model" title="Validation Model">Section 4.2</a>), and870 </li> 871 <li>the stored response does not contain the no-cache cache directive (<a href="#cache-response-directive.no-cache" title="no-cache">Section 7.2.2.3</a>), unless it is successfully validated (<a href="#validation.model" title="Validation Model">Section 4.2</a>), and868 <li>the presented request does not contain the no-cache pragma (<a href="#header.pragma" id="rfc.xref.header.pragma.1" title="Pragma">Section 7.4</a>), nor the no-cache cache directive (<a href="#cache-request-directive" title="Request Cache-Control Directives">Section 7.2.1</a>), unless the stored response is successfully validated (<a href="#validation.model" title="Validation">Section 4.2</a>), and 869 </li> 870 <li>the stored response does not contain the no-cache cache directive (<a href="#cache-response-directive.no-cache" title="no-cache">Section 7.2.2.3</a>), unless it is successfully validated (<a href="#validation.model" title="Validation">Section 4.2</a>), and 872 871 </li> 873 872 <li>the stored response is either: 874 873 <ul> 875 <li>fresh (see <a href="#expiration.model" title="Freshness Model">Section 4.1</a>), or874 <li>fresh (see <a href="#expiration.model" title="Freshness">Section 4.1</a>), or 876 875 </li> 877 876 <li>allowed to be served stale (see <a href="#serving.stale.responses" title="Serving Stale Responses">Section 4.1.4</a>), or 878 877 </li> 879 <li>successfully validated (see <a href="#validation.model" title="Validation Model">Section 4.2</a>).878 <li>successfully validated (see <a href="#validation.model" title="Validation">Section 4.2</a>). 880 879 </li> 881 880 </ul> … … 884 883 <p id="rfc.section.4.p.2">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 7.2.3</a>. 885 884 </p> 886 <p id="rfc.section.4.p.3">When a stored response is used to satisfy a request without validation, a cache <em class="bcp14">MUST</em> send a single <a href="#header.age" class="smpl">Age</a> header field (<a href="#header.age" id="rfc.xref.header.age.1" title="Age">Section 7.1</a>)in the response with a value equal to the stored response's current_age; see <a href="#age.calculations" title="Calculating Age">Section 4.1.3</a>.885 <p id="rfc.section.4.p.3">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 7.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 4.1.3</a>. 887 886 </p> 888 887 <p id="rfc.section.4.p.4">A cache <em class="bcp14">MUST</em> write through requests with methods that are unsafe (<a href="p2-semantics.html#safe.methods" title="Safe Methods">Section 4.2.1</a> of <a href="#Part2" id="rfc.xref.Part2.3"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[Part2]</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 … … 891 890 <p id="rfc.section.4.p.5">Also, note that unsafe requests might invalidate already stored responses; see <a href="#invalidation.after.updates.or.deletions" title="Request Methods that Invalidate">Section 6</a>. 892 891 </p> 893 <p id="rfc.section.4.p.6">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="p2-semantics.html#header.date" class="smpl">Date</a> header field). It can also forward arequest with "Cache-Control: max-age=0" or "Cache-Control: no-cache" to disambiguate892 <p id="rfc.section.4.p.6">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="p2-semantics.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 894 893 which response to use. 895 894 </p> 896 <p id="rfc.section.4.p.7">A cache that does not have a clock available <em class="bcp14">MUST NOT</em> use stored responses without revalidating them on every use.897 </p> 898 <h2 id="rfc.section.4.1"><a href="#rfc.section.4.1">4.1</a> <a id="expiration.model" href="#expiration.model">Freshness Model</a></h2>895 <p id="rfc.section.4.p.7">A cache that does not have a clock available <em class="bcp14">MUST NOT</em> use stored responses without revalidating them upon every use. 896 </p> 897 <h2 id="rfc.section.4.1"><a href="#rfc.section.4.1">4.1</a> <a id="expiration.model" href="#expiration.model">Freshness</a></h2> 899 898 <p id="rfc.section.4.1.p.1">When a response is "fresh" in the cache, it can be used to satisfy subsequent requests without contacting the origin server, 900 899 thereby improving efficiency. … … 913 912 <div id="rfc.figure.u.2"></div> 914 913 <p>The calculation to determine if a response is fresh is:</p><pre class="text"> response_is_fresh = (freshness_lifetime > current_age) 915 </pre><p id="rfc.section.4.1.p.6"> The freshness_lifetime is defined in <a href="#calculating.freshness.lifetime" title="Calculating Freshness Lifetime">Section 4.1.1</a>; thecurrent_age is defined in <a href="#age.calculations" title="Calculating Age">Section 4.1.3</a>.914 </pre><p id="rfc.section.4.1.p.6">freshness_lifetime is defined in <a href="#calculating.freshness.lifetime" title="Calculating Freshness Lifetime">Section 4.1.1</a>; current_age is defined in <a href="#age.calculations" title="Calculating Age">Section 4.1.3</a>. 916 915 </p> 917 916 <p id="rfc.section.4.1.p.7">Clients can send the max-age or min-fresh cache directives in a request to constrain or relax freshness calculations for the … … 934 933 </ul> 935 934 <p id="rfc.section.4.1.1.p.2">Note that this calculation is not vulnerable to clock skew, since all of the information comes from the origin server.</p> 936 <p id="rfc.section.4.1.1.p.3">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), it is considered invalid. Caches are encouraged to consider responses937 t hat have invalid freshness information to be stale.935 <p id="rfc.section.4.1.1.p.3">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 936 to consider responses that have invalid freshness information to be stale. 938 937 </p> 939 938 <h3 id="rfc.section.4.1.2"><a href="#rfc.section.4.1.2">4.1.2</a> <a id="heuristic.freshness" href="#heuristic.freshness">Calculating Heuristic Freshness</a></h3> … … 947 946 "public" response cache directive). 948 947 </p> 949 <p id="rfc.section.4.1.2.p.3">If the response has a <a href="p4-conditional.html#header.last-modified" class="smpl">Last-Modified</a> header field (<a href="p4-conditional.html#header.last-modified" title="Last-Modified">Section 2.2</a> of <a href="#Part4" id="rfc.xref.Part4. 4"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[Part4]</cite></a>), caches are encouraged to use a heuristic expiration value that is no more than some fraction of the interval since that948 <p id="rfc.section.4.1.2.p.3">If the response has a <a href="p4-conditional.html#header.last-modified" class="smpl">Last-Modified</a> header field (<a href="p4-conditional.html#header.last-modified" title="Last-Modified">Section 2.2</a> of <a href="#Part4" id="rfc.xref.Part4.2"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[Part4]</cite></a>), caches are encouraged to use a heuristic expiration value that is no more than some fraction of the interval since that 950 949 time. A typical setting of this fraction might be 10%. 951 950 </p> … … 955 954 <div class="note" id="rfc.section.4.1.2.p.5"> 956 955 <p> <b>Note:</b> <a href="http://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, 957 this has not been widely implemented. Therefore, servers are encouraged to send explicit directives (e.g., Cache-Control:956 this has not been widely implemented. Therefore, origin servers are encouraged to send explicit directives (e.g., Cache-Control: 958 957 no-cache) if they wish to preclude caching. 959 958 </p> … … 1030 1029 <h3 id="rfc.section.4.1.4"><a href="#rfc.section.4.1.4">4.1.4</a> <a id="serving.stale.responses" href="#serving.stale.responses">Serving Stale Responses</a></h3> 1031 1030 <p id="rfc.section.4.1.4.p.1">A "stale" response is one that either has explicit expiry information or is allowed to have heuristic expiry calculated, but 1032 is not fresh according to the calculations in <a href="#expiration.model" title="Freshness Model">Section 4.1</a>.1031 is not fresh according to the calculations in <a href="#expiration.model" title="Freshness">Section 4.1</a>. 1033 1032 </p> 1034 1033 <p id="rfc.section.4.1.4.p.2">A cache <em class="bcp14">MUST NOT</em> send a stale response if it is prohibited by an explicit in-protocol directive (e.g., by a "no-store" or "no-cache" cache … … 1041 1040 <p id="rfc.section.4.1.4.p.4">A cache <em class="bcp14">SHOULD</em> append a <a href="#header.warning" class="smpl">Warning</a> header field with the 110 warn-code (see <a href="#header.warning" id="rfc.xref.header.warning.1" title="Warning">Section 7.5</a>) to stale responses. Likewise, a cache <em class="bcp14">SHOULD</em> add the 112 warn-code to stale responses if the cache is disconnected. 1042 1041 </p> 1043 <p id="rfc.section.4.1.4.p.5"> If a cache receives a first-hand response (either an entire response, or a <a href="p4-conditional.html#status.304" class="smpl">304 (Not Modified)</a> response) that it would normally forward to the requesting client, and the received response is no longer fresh, the cache1042 <p id="rfc.section.4.1.4.p.5">note that if a cache receives a first-hand response (either an entire response, or a <a href="p4-conditional.html#status.304" class="smpl">304 (Not Modified)</a> response) that it would normally forward to the requesting client, and the received response is no longer fresh, the cache 1044 1043 can forward it to the requesting client without adding a new <a href="#header.warning" class="smpl">Warning</a> (but without removing any existing Warning header fields). A cache shouldn't attempt to validate a response simply because 1045 1044 that response became stale in transit. 1046 1045 </p> 1047 <h2 id="rfc.section.4.2"><a href="#rfc.section.4.2">4.2</a> <a id="validation.model" href="#validation.model">Validation Model</a></h2>1046 <h2 id="rfc.section.4.2"><a href="#rfc.section.4.2">4.2</a> <a id="validation.model" href="#validation.model">Validation</a></h2> 1048 1047 <p id="rfc.section.4.2.p.1">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 1049 fresh, or one cannot be selected; see <a href="#caching.negotiated.responses" title="Using Negotiated Responses">Section 4.3</a>), it can use the conditional request mechanism <a href="#Part4" id="rfc.xref.Part4. 5"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[Part4]</cite></a> in the forwarded request to give the origin server an opportunity to both select a valid stored response to be used, and to1048 fresh, or one cannot be selected; see <a href="#caching.negotiated.responses" title="Using Negotiated Responses">Section 4.3</a>), it can use the conditional request mechanism <a href="#Part4" id="rfc.xref.Part4.3"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests">[Part4]</cite></a> in the forwarded request to give the origin server an opportunity to both select a valid stored response to be used, and to 1050 1049 update it. This process is known as "validating" or "revalidating" the stored response. 1051 1050 </p> 1052 1051 <p id="rfc.section.4.2.p.2">When sending such a conditional request, a cache adds an <a href="p4-conditional.html#header.if-modified-since" class="smpl">If-Modified-Since</a> header field whose value is that of the <a href="p4-conditional.html#header.last-modified" class="smpl">Last-Modified</a> header field from the selected (see <a href="#caching.negotiated.responses" title="Using Negotiated Responses">Section 4.3</a>) stored response, if available. 1053 1052 </p> 1054 <p id="rfc.section.4.2.p.3">Additionally, a cache can add an <a href="p4-conditional.html#header.if-none-match" class="smpl">If-None-Match</a> header field whose value is that of the <a href="p4-conditional.html#header.etag" class="smpl">ETag</a> header field(s) from all responses stored for the requested URI, if present. However, if any of the stored responses contains1055 only partial content, the cache shouldn't include its entity-tag in the If-None-Match header field unless the request is for1056 a range that would be fully satisfied by that stored response.1053 <p id="rfc.section.4.2.p.3">Additionally, a cache can add an <a href="p4-conditional.html#header.if-none-match" class="smpl">If-None-Match</a> header field whose value is that of the <a href="p4-conditional.html#header.etag" class="smpl">ETag</a> header field(s) from relevant responses stored for the primary cache key, if present. However, if any of the stored responses 1054 contains only partial content, the cache shouldn't include its entity-tag in the If-None-Match header field unless the request 1055 is for a range that would be fully satisfied by that stored response. 1057 1056 </p> 1058 1057 <p id="rfc.section.4.2.p.4">Cache handling of a response to a conditional request is dependent upon its status code:</p> … … 1074 1073 <p id="rfc.section.4.2.1.p.2">The stored response to update is identified by using the first match (if any) of: </p> 1075 1074 <ul> 1076 <li>If the new response contains a strong validator, then that strong validator identifies the selected representation . All of1077 the stored responses with the same strong validator are selected. If none of the stored responses contain the same strong1078 validator, then the new response <em class="bcp14">MUST NOT</em> be used to update any stored responses.1075 <li>If the new response contains a strong validator, then that strong validator identifies the selected representation for update. 1076 All of the stored responses with the same strong validator are selected. If none of the stored responses contain the same 1077 strong validator, then the new response <em class="bcp14">MUST NOT</em> be used to update any stored responses. 1079 1078 </li> 1080 1079 <li>If the new response contains a weak validator and that validator corresponds to one of the cache's stored responses, then 1081 the most recent of those matching stored responses is selected .1080 the most recent of those matching stored responses is selected for update. 1082 1081 </li> 1083 1082 <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 1084 1083 request from a source other than the Last-Modified response header field), and there is only one stored response, and that 1085 stored response also lacks a validator, then that stored response is selected .1084 stored response also lacks a validator, then that stored response is selected for update. 1086 1085 </li> 1087 1086 </ul> … … 1121 1120 </p> 1122 1121 <p id="rfc.section.4.3.p.7">If no selected response is available, the cache cannot satisfy the presented request. Typically, it is forwarded to the origin 1123 server in a (possibly conditional; see <a href="#validation.model" title="Validation Model">Section 4.2</a>) request.1122 server in a (possibly conditional; see <a href="#validation.model" title="Validation">Section 4.2</a>) request. 1124 1123 </p> 1125 1124 <h2 id="rfc.section.4.4"><a href="#rfc.section.4.4">4.4</a> <a id="combining.responses" href="#combining.responses">Combining Partial Content</a></h2> … … 1169 1168 request. 1170 1169 </p> 1171 <p id="rfc.section.6.p.6">Note that this does not guarantee that all appropriate responses are invalidated. For example, the request that caused the 1172 change at the origin server might not have gone through the cache where a response is stored. 1170 <p id="rfc.section.6.p.6">Note that this does not guarantee that all appropriate responses are invalidated. For example, a state-changing request might 1171 invalidate responses in the caches it travels through, but relevant responses still might be stored in other caches that it 1172 has not. 1173 1173 </p> 1174 1174 <h1 id="rfc.section.7"><a href="#rfc.section.7">7.</a> <a id="header.field.definitions" href="#header.field.definitions">Header Field Definitions</a></h1> … … 1180 1180 </p> 1181 1181 <div id="rfc.figure.u.6"></div><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> 1182 </pre><p id="rfc.section.7.1.p.3">Age field-values are non-negative integers, representing time in seconds (see <a href="#delta-seconds" title="Delta Seconds">Section 1. 4.1</a>).1182 </pre><p id="rfc.section.7.1.p.3">Age field-values are non-negative integers, representing time in seconds (see <a href="#delta-seconds" title="Delta Seconds">Section 1.3.1</a>). 1183 1183 </p> 1184 1184 <p id="rfc.section.7.1.p.4">The presence of an Age header field in a response implies that a response is not first-hand. However, the converse is not … … 1194 1194 </p> 1195 1195 <div class="note" id="rfc.section.7.2.p.3"> 1196 <p> <b>Note:</b> 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.2" title="Pragma">Section 7.4</a>).1196 <p> <b>Note:</b> some HTTP/1.0 caches might not implement Cache-Control. 1197 1197 </p> 1198 1198 </div> … … 1228 1228 <p id="rfc.section.7.2.1.3.p.1">Argument syntax: </p> 1229 1229 <ul class="empty"> 1230 <li> <a href="#delta-seconds" class="smpl">delta-seconds</a> (see <a href="#delta-seconds" title="Delta Seconds">Section 1. 4.1</a>)1230 <li> <a href="#delta-seconds" class="smpl">delta-seconds</a> (see <a href="#delta-seconds" title="Delta Seconds">Section 1.3.1</a>) 1231 1231 </li> 1232 1232 </ul> … … 1241 1241 <p id="rfc.section.7.2.1.4.p.1">Argument syntax: </p> 1242 1242 <ul class="empty"> 1243 <li> <a href="#delta-seconds" class="smpl">delta-seconds</a> (see <a href="#delta-seconds" title="Delta Seconds">Section 1. 4.1</a>)1244 </li> 1245 </ul> 1246 <p id="rfc.section.7.2.1.4.p.2">The "max-stale" request directive indicates that the client is willing to accept a response that has exceeded its expiration1247 time. If max-stale is assigned a value, then the client is willing to accept a response that has exceeded its expiration time1248 by no more than the specified number of seconds. If no value is assigned to max-stale, then the client is willing to accept1249 a stale response of any age.1243 <li> <a href="#delta-seconds" class="smpl">delta-seconds</a> (see <a href="#delta-seconds" title="Delta Seconds">Section 1.3.1</a>) 1244 </li> 1245 </ul> 1246 <p id="rfc.section.7.2.1.4.p.2">The "max-stale" request directive indicates that the client is willing to accept a response that has exceeded its freshness 1247 lifetime. If max-stale is assigned a value, then the client is willing to accept a response that has exceeded its freshness 1248 lifetime by no more than the specified number of seconds. If no value is assigned to max-stale, then the client is willing 1249 to accept a stale response of any age. 1250 1250 </p> 1251 1251 <p id="rfc.section.7.2.1.4.p.3"> <b>Note:</b> This directive uses the token form of the argument syntax; e.g., 'max-stale=10', not 'max-stale="10"'. Senders <em class="bcp14">SHOULD NOT</em> use the quoted-string form. … … 1255 1255 <p id="rfc.section.7.2.1.5.p.1">Argument syntax: </p> 1256 1256 <ul class="empty"> 1257 <li> <a href="#delta-seconds" class="smpl">delta-seconds</a> (see <a href="#delta-seconds" title="Delta Seconds">Section 1. 4.1</a>)1257 <li> <a href="#delta-seconds" class="smpl">delta-seconds</a> (see <a href="#delta-seconds" title="Delta Seconds">Section 1.3.1</a>) 1258 1258 </li> 1259 1259 </ul> … … 1292 1292 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. 1293 1293 </p> 1294 <p id="rfc.section.7.2.2.2.p.4">The field-names given are not limited to the set of standard header fields defined by this specification. Field names are 1295 case-insensitive. 1296 </p> 1294 <p id="rfc.section.7.2.2.2.p.4">The field-names given are not limited to the set of header fields defined by this specification. Field names are case-insensitive.</p> 1297 1295 <p id="rfc.section.7.2.2.2.p.5"> <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 1298 1296 content. Also, private response directives with field-names are often handled by implementations as if an unqualified private … … 1316 1314 server to prevent the re-use of certain header fields in a response, while still allowing caching of the rest of the response. 1317 1315 </p> 1318 <p id="rfc.section.7.2.2.3.p.4">The field-names given are not limited to the set of standard header fields defined by this specification. Field names are 1319 case-insensitive. 1320 </p> 1321 <p id="rfc.section.7.2.2.3.p.5"> <b>Note:</b> Many HTTP/1.0 caches will not recognize or obey this directive. Also, no-cache response directives with field-names are often 1322 handled by implementations as if an unqualified no-cache directive was received; i.e., the special handling for the qualified 1323 form is not widely implemented. 1316 <p id="rfc.section.7.2.2.3.p.4">The field-names given are not limited to the set of header fields defined by this specification. Field names are case-insensitive.</p> 1317 <p id="rfc.section.7.2.2.3.p.5"> <b>Note:</b> Although it has been back-ported to many implementations, some HTTP/1.0 caches will not recognize or obey this directive. 1318 Also, no-cache response directives with field-names are often handled by implementations as if an unqualified no-cache directive 1319 was received; i.e., the special handling for the qualified form is not widely implemented. 1324 1320 </p> 1325 1321 <p id="rfc.section.7.2.2.3.p.6"> <b>Note:</b> This directive uses the quoted-string form of the argument syntax. Senders <em class="bcp14">SHOULD NOT</em> use the token form (even if quoting appears not to be needed for single-entry lists). … … 1351 1347 <p id="rfc.section.7.2.2.7.p.1">Argument syntax: </p> 1352 1348 <ul class="empty"> 1353 <li> <a href="#delta-seconds" class="smpl">delta-seconds</a> (see <a href="#delta-seconds" title="Delta Seconds">Section 1. 4.1</a>)1349 <li> <a href="#delta-seconds" class="smpl">delta-seconds</a> (see <a href="#delta-seconds" title="Delta Seconds">Section 1.3.1</a>) 1354 1350 </li> 1355 1351 </ul> … … 1363 1359 <p id="rfc.section.7.2.2.8.p.1">Argument syntax: </p> 1364 1360 <ul class="empty"> 1365 <li> <a href="#delta-seconds" class="smpl">delta-seconds</a> (see <a href="#delta-seconds" title="Delta Seconds">Section 1. 4.1</a>)1361 <li> <a href="#delta-seconds" class="smpl">delta-seconds</a> (see <a href="#delta-seconds" title="Delta Seconds">Section 1.3.1</a>) 1366 1362 </li> 1367 1363 </ul> … … 1377 1373 <h3 id="rfc.section.7.2.3"><a href="#rfc.section.7.2.3">7.2.3</a> <a id="cache.control.extensions" href="#cache.control.extensions">Cache Control Extensions</a></h3> 1378 1374 <p id="rfc.section.7.2.3.p.1">The Cache-Control header field can be extended through the use of one or more cache-extension tokens, each with an optional 1379 value. Informational extensions (those that do not require a change in cache behavior) can be added without changing the semantics 1375 value. 1376 </p> 1377 <p id="rfc.section.7.2.3.p.2">Informational extensions (those that do not require a change in cache behavior) can be added without changing the semantics 1380 1378 of other directives. Behavioral extensions are designed to work by acting as modifiers to the existing base of cache directives. 1381 Both the new directive and the standard directive are supplied, such that applications that do not understand the new directive 1379 </p> 1380 <p id="rfc.section.7.2.3.p.3">Both the new directive and the standard directive are supplied, such that applications that do not understand the new directive 1382 1381 will default to the behavior specified by the standard directive, and those that understand the new directive will recognize 1383 1382 it as modifying the requirements associated with the standard directive. In this way, extensions to the cache-control directives 1384 1383 can be made without requiring changes to the base protocol. 1385 1384 </p> 1386 <p id="rfc.section.7.2.3.p. 2">This extension mechanism depends on an HTTP cache obeying all of the cache-control directives defined for its native HTTP-version,1385 <p id="rfc.section.7.2.3.p.4">This extension mechanism depends on an HTTP cache obeying all of the cache-control directives defined for its native HTTP-version, 1387 1386 obeying certain extensions, and ignoring all directives that it does not understand. 1388 1387 </p> 1389 <p id="rfc.section.7.2.3.p. 3">For example, consider a hypothetical new response directive called "community" that acts as a modifier to the private directive.1388 <p id="rfc.section.7.2.3.p.5">For example, consider a hypothetical new response directive called "community" that acts as a modifier to the private directive. 1390 1389 We define this new directive to mean that, in addition to any private cache, any cache that is shared only by members of the 1391 1390 community named within its value is allowed to cache the response. An origin server wishing to allow the UCI community to … … 1393 1392 </p> 1394 1393 <div id="rfc.figure.u.8"></div><pre class="text"> Cache-Control: private, community="UCI" 1395 </pre><p id="rfc.section.7.2.3.p. 5">A cache seeing this header field will act correctly even if the cache does not understand the community cache-extension, since1394 </pre><p id="rfc.section.7.2.3.p.7">A cache seeing this header field will act correctly even if the cache does not understand the community cache-extension, since 1396 1395 it will also see and understand the private directive and thus default to the safe behavior. 1397 1396 </p> 1398 <p id="rfc.section.7.2.3.p. 6">A cache <em class="bcp14">MUST</em> ignore unrecognized cache directives; it is assumed that any cache directive likely to be unrecognized by an HTTP/1.1 cache1397 <p id="rfc.section.7.2.3.p.8">A cache <em class="bcp14">MUST</em> ignore unrecognized cache directives; it is assumed that any cache directive likely to be unrecognized by an HTTP/1.1 cache 1399 1398 will be combined with standard directives (or the response's default cacheability) such that the cache behavior will remain 1400 1399 minimally correct even if the cache does not understand the extension(s). 1401 1400 </p> 1402 <p id="rfc.section.7.2.3.p. 7">New extension directives ought to consider defining:</p>1403 <p id="rfc.section.7.2.3.p. 8"> </p>1401 <p id="rfc.section.7.2.3.p.9">New extension directives ought to consider defining:</p> 1402 <p id="rfc.section.7.2.3.p.10"> </p> 1404 1403 <ul> 1405 1404 <li>What it means for a directive to be specified multiple times,</li> 1406 1405 <li>When the directive does not take an argument, what it means when an argument is present,</li> 1407 <li>When the directive requires an argument, what it means when it is missing.</li> 1408 </ul> 1409 <p id="rfc.section.7.2.3.p.9">The HTTP Cache Directive Registry defines the name space for the cache directives.</p> 1410 <p id="rfc.section.7.2.3.p.10">A registration <em class="bcp14">MUST</em> include the following fields: 1406 <li>When the directive requires an argument, what it means when it is missing,</li> 1407 <li>Whether the directive is specific to requests, responses, or able to be used in either.</li> 1408 </ul> 1409 <p id="rfc.section.7.2.3.p.11">The HTTP Cache Directive Registry defines the name space for the cache directives.</p> 1410 <p id="rfc.section.7.2.3.p.12">A registration <em class="bcp14">MUST</em> include the following fields: 1411 1411 </p> 1412 1412 <ul> … … 1414 1414 <li>Pointer to specification text</li> 1415 1415 </ul> 1416 <p id="rfc.section.7.2.3.p.1 1">Values to be added to this name space 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="http://tools.ietf.org/html/rfc5226#section-4.1">Section 4.1</a>).1417 </p> 1418 <p id="rfc.section.7.2.3.p.1 2">The registry itself is maintained at <<a href="http://www.iana.org/assignments/http-cache-directives">http://www.iana.org/assignments/http-cache-directives</a>>.1416 <p id="rfc.section.7.2.3.p.13">Values to be added to this name space 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="http://tools.ietf.org/html/rfc5226#section-4.1">Section 4.1</a>). 1417 </p> 1418 <p id="rfc.section.7.2.3.p.14">The registry itself is maintained at <<a href="http://www.iana.org/assignments/http-cache-directives">http://www.iana.org/assignments/http-cache-directives</a>>. 1419 1419 </p> 1420 1420 <div id="rfc.iref.e.2"></div> 1421 1421 <h2 id="rfc.section.7.3"><a href="#rfc.section.7.3">7.3</a> <a id="header.expires" href="#header.expires">Expires</a></h2> 1422 <p id="rfc.section.7.3.p.1">The "Expires" header field gives the date/time after which the response is considered stale. See <a href="#expiration.model" title="Freshness Model">Section 4.1</a> for further discussion of the freshness model.1422 <p id="rfc.section.7.3.p.1">The "Expires" header field gives the date/time after which the response is considered stale. See <a href="#expiration.model" title="Freshness">Section 4.1</a> for further discussion of the freshness model. 1423 1423 </p> 1424 1424 <p id="rfc.section.7.3.p.2">The presence of an Expires field does not imply that the original resource will change or cease to exist at, before, or after … … 1570 1570 retrieved earlier in a session. 1571 1571 </p> 1572 <p id="rfc.section.8.p.2">The freshness model (<a href="#expiration.model" title="Freshness Model">Section 4.1</a>) does not necessarily apply to history mechanisms. I.e., a history mechanism can display a previous representation even if1572 <p id="rfc.section.8.p.2">The freshness model (<a href="#expiration.model" title="Freshness">Section 4.1</a>) does not necessarily apply to history mechanisms. I.e., a history mechanism can display a previous representation even if 1573 1573 it has expired. 1574 1574 </p> … … 1766 1766 <td class="left">http</td> 1767 1767 <td class="left">standard</td> 1768 <td class="left"> <a href="#header.pragma" id="rfc.xref.header.pragma. 3" title="Pragma">Section 7.4</a>1768 <td class="left"> <a href="#header.pragma" id="rfc.xref.header.pragma.2" title="Pragma">Section 7.4</a> 1769 1769 </td> 1770 1770 </tr> … … 1900 1900 (<a href="#age.calculations" title="Calculating Age">Section 4.1.3</a>) 1901 1901 </p> 1902 <p id="rfc.section.A.p.4">The <a href="p2-semantics.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 Model">Section 4.2</a>)1902 <p id="rfc.section.A.p.4">The <a href="p2-semantics.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 4.2</a>) 1903 1903 </p> 1904 1904 <p id="rfc.section.A.p.5">The algorithm for selecting a cached negotiated response to use has been clarified in several ways. In particular, it now … … 1914 1914 (<a href="#header.expires" id="rfc.xref.header.expires.5" title="Expires">Section 7.3</a>) 1915 1915 </p> 1916 <p id="rfc.section.A.p.10">The Pragma header field is now only defined for backwards compatibility; future pragmas are deprecated. (<a href="#header.pragma" id="rfc.xref.header.pragma. 4" title="Pragma">Section 7.4</a>)1916 <p id="rfc.section.A.p.10">The Pragma 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 7.4</a>) 1917 1917 </p> 1918 1918 <p id="rfc.section.A.p.11">Cache directives are explicitly defined to be case-insensitive. (<a href="#header.cache-control" id="rfc.xref.header.cache-control.3" title="Cache-Control">Section 7.2</a>) … … 2073 2073 </li> 2074 2074 <li><a id="rfc.index.A" href="#rfc.index.A"><b>A</b></a><ul> 2075 <li>age <a href="#rfc.iref.a.1">1. 2</a></li>2075 <li>age <a href="#rfc.iref.a.1">1.1</a></li> 2076 2076 <li>Age header field <a href="#rfc.xref.header.age.1">4</a>, <a href="#rfc.xref.header.age.2">4.1.3</a>, <a href="#rfc.iref.a.2"><b>7.1</b></a>, <a href="#rfc.xref.header.age.3">9.3</a></li> 2077 2077 </ul> … … 2082 2082 </li> 2083 2083 <li><a id="rfc.index.C" href="#rfc.index.C"><b>C</b></a><ul> 2084 <li>cache <a href="#rfc.iref.c.1">1 .1</a>, <a href="#rfc.iref.c.2">1.2</a></li>2084 <li>cache <a href="#rfc.iref.c.1">1</a>, <a href="#rfc.iref.c.2">1.1</a></li> 2085 2085 <li>cache entry <a href="#rfc.iref.c.4">2</a></li> 2086 2086 <li>cache key <a href="#rfc.iref.c.5">2</a></li> 2087 2087 <li>Cache-Control header field <a href="#rfc.xref.header.cache-control.1">3</a>, <a href="#rfc.iref.c.6"><b>7.2</b></a>, <a href="#rfc.xref.header.cache-control.2">9.3</a>, <a href="#rfc.xref.header.cache-control.3">A</a>, <a href="#rfc.xref.header.cache-control.4">A</a></li> 2088 <li>cacheable <a href="#rfc.iref.c.3">1. 2</a></li>2088 <li>cacheable <a href="#rfc.iref.c.3">1.1</a></li> 2089 2089 </ul> 2090 2090 </li> 2091 2091 <li><a id="rfc.index.E" href="#rfc.index.E"><b>E</b></a><ul> 2092 2092 <li>Expires header field <a href="#rfc.xref.header.expires.1">3</a>, <a href="#rfc.xref.header.expires.2">4.1</a>, <a href="#rfc.xref.header.expires.3">4.1.1</a>, <a href="#rfc.iref.e.2"><b>7.3</b></a>, <a href="#rfc.xref.header.expires.4">9.3</a>, <a href="#rfc.xref.header.expires.5">A</a></li> 2093 <li>explicit expiration time <a href="#rfc.iref.e.1">1. 2</a></li>2093 <li>explicit expiration time <a href="#rfc.iref.e.1">1.1</a></li> 2094 2094 </ul> 2095 2095 </li> 2096 2096 <li><a id="rfc.index.F" href="#rfc.index.F"><b>F</b></a><ul> 2097 <li>first-hand <a href="#rfc.iref.f.1">1. 2</a></li>2098 <li>fresh <a href="#rfc.iref.f.3">1. 2</a></li>2099 <li>freshness lifetime <a href="#rfc.iref.f.2">1. 2</a></li>2097 <li>first-hand <a href="#rfc.iref.f.1">1.1</a></li> 2098 <li>fresh <a href="#rfc.iref.f.3">1.1</a></li> 2099 <li>freshness lifetime <a href="#rfc.iref.f.2">1.1</a></li> 2100 2100 </ul> 2101 2101 </li> … … 2106 2106 <li><tt>Cache-Control</tt> <a href="#rfc.iref.g.3"><b>7.2</b></a></li> 2107 2107 <li><tt>cache-directive</tt> <a href="#rfc.iref.g.4"><b>7.2</b></a></li> 2108 <li><tt>delta-seconds</tt> <a href="#rfc.iref.g.1"><b>1. 4.1</b></a></li>2108 <li><tt>delta-seconds</tt> <a href="#rfc.iref.g.1"><b>1.3.1</b></a></li> 2109 2109 <li><tt>Expires</tt> <a href="#rfc.iref.g.5"><b>7.3</b></a></li> 2110 2110 <li><tt>extension-pragma</tt> <a href="#rfc.iref.g.8"><b>7.4</b></a></li> … … 2122 2122 </li> 2123 2123 <li><a id="rfc.index.H" href="#rfc.index.H"><b>H</b></a><ul> 2124 <li>heuristic expiration time <a href="#rfc.iref.h.1">1. 2</a></li>2124 <li>heuristic expiration time <a href="#rfc.iref.h.1">1.1</a></li> 2125 2125 </ul> 2126 2126 </li> … … 2143 2143 </li> 2144 2144 <li><a id="rfc.index.P" href="#rfc.index.P"><b>P</b></a><ul> 2145 <li><em>Part1</em> <a href="#rfc.xref.Part1.1">1. 3</a>, <a href="#rfc.xref.Part1.2">1.4</a>, <a href="#rfc.xref.Part1.3">3.1</a>, <a href="#rfc.xref.Part1.4">4</a>, <a href="#rfc.xref.Part1.5">4.3</a>, <a href="#rfc.xref.Part1.6">6</a>, <a href="#rfc.xref.Part1.7">6</a>, <a href="#rfc.xref.Part1.8">6</a>, <a href="#rfc.xref.Part1.9">7.2.1.6</a>, <a href="#rfc.xref.Part1.10">7.2.2.9</a>, <a href="#rfc.xref.Part1.11">10</a>, <a href="#rfc.xref.Part1.12">11</a>, <a href="#Part1"><b>12.1</b></a>, <a href="#rfc.xref.Part1.13">B</a>, <a href="#rfc.xref.Part1.14">B</a>, <a href="#rfc.xref.Part1.15">B</a>, <a href="#rfc.xref.Part1.16">B</a>, <a href="#rfc.xref.Part1.17">B</a>, <a href="#rfc.xref.Part1.18">B</a>, <a href="#rfc.xref.Part1.19">B</a>, <a href="#rfc.xref.Part1.20">B</a>, <a href="#rfc.xref.Part1.21">C</a><ul>2146 <li><em>Section 1.2</em> <a href="#rfc.xref.Part1.2">1. 4</a>, <a href="#rfc.xref.Part1.21">C</a></li>2147 <li><em>Section 2.5</em> <a href="#rfc.xref.Part1.1">1. 3</a></li>2145 <li><em>Part1</em> <a href="#rfc.xref.Part1.1">1.2</a>, <a href="#rfc.xref.Part1.2">1.3</a>, <a href="#rfc.xref.Part1.3">3.1</a>, <a href="#rfc.xref.Part1.4">4</a>, <a href="#rfc.xref.Part1.5">4.3</a>, <a href="#rfc.xref.Part1.6">6</a>, <a href="#rfc.xref.Part1.7">6</a>, <a href="#rfc.xref.Part1.8">6</a>, <a href="#rfc.xref.Part1.9">7.2.1.6</a>, <a href="#rfc.xref.Part1.10">7.2.2.9</a>, <a href="#rfc.xref.Part1.11">10</a>, <a href="#rfc.xref.Part1.12">11</a>, <a href="#Part1"><b>12.1</b></a>, <a href="#rfc.xref.Part1.13">B</a>, <a href="#rfc.xref.Part1.14">B</a>, <a href="#rfc.xref.Part1.15">B</a>, <a href="#rfc.xref.Part1.16">B</a>, <a href="#rfc.xref.Part1.17">B</a>, <a href="#rfc.xref.Part1.18">B</a>, <a href="#rfc.xref.Part1.19">B</a>, <a href="#rfc.xref.Part1.20">B</a>, <a href="#rfc.xref.Part1.21">C</a><ul> 2146 <li><em>Section 1.2</em> <a href="#rfc.xref.Part1.2">1.3</a>, <a href="#rfc.xref.Part1.21">C</a></li> 2147 <li><em>Section 2.5</em> <a href="#rfc.xref.Part1.1">1.2</a></li> 2148 2148 <li><em>Section 2.7</em> <a href="#rfc.xref.Part1.18">B</a>, <a href="#rfc.xref.Part1.20">B</a></li> 2149 2149 <li><em>Section 3.2</em> <a href="#rfc.xref.Part1.5">4.3</a>, <a href="#rfc.xref.Part1.15">B</a></li> … … 2164 2164 </ul> 2165 2165 </li> 2166 <li><em>Part4</em> <a href="#rfc.xref.Part4.1">1.2</a>, <a href="#rfc.xref.Part4.2">1.2</a>, <a href="#rfc.xref.Part4.3">1.2</a>, <a href="#rfc.xref.Part4.4">4.1.2</a>, <a href="#rfc.xref.Part4.5">4.2</a>, <a href="#Part4"><b>12.1</b></a><ul> 2167 <li><em>Section 2.1</em> <a href="#rfc.xref.Part4.1">1.2</a></li> 2168 <li><em>Section 2.2</em> <a href="#rfc.xref.Part4.4">4.1.2</a></li> 2169 <li><em>Section 2.2.2</em> <a href="#rfc.xref.Part4.3">1.2</a></li> 2170 <li><em>Section 2.3</em> <a href="#rfc.xref.Part4.2">1.2</a></li> 2166 <li><em>Part4</em> <a href="#rfc.xref.Part4.1">1.1</a>, <a href="#rfc.xref.Part4.2">4.1.2</a>, <a href="#rfc.xref.Part4.3">4.2</a>, <a href="#Part4"><b>12.1</b></a><ul> 2167 <li><em>Section 2.1</em> <a href="#rfc.xref.Part4.1">1.1</a></li> 2168 <li><em>Section 2.2</em> <a href="#rfc.xref.Part4.2">4.1.2</a></li> 2171 2169 </ul> 2172 2170 </li> … … 2179 2177 </ul> 2180 2178 </li> 2181 <li>Pragma header field <a href="#rfc.xref.header.pragma.1">4</a>, <a href="#rfc. xref.header.pragma.2">7.2</a>, <a href="#rfc.iref.p.5"><b>7.4</b></a>, <a href="#rfc.xref.header.pragma.3">9.3</a>, <a href="#rfc.xref.header.pragma.4">A</a></li>2179 <li>Pragma header field <a href="#rfc.xref.header.pragma.1">4</a>, <a href="#rfc.iref.p.5"><b>7.4</b></a>, <a href="#rfc.xref.header.pragma.2">9.3</a>, <a href="#rfc.xref.header.pragma.3">A</a></li> 2182 2180 <li>private (cache directive) <a href="#rfc.iref.p.3"><b>7.2.2.2</b></a></li> 2183 <li>private cache <a href="#rfc.iref.p.1">1. 2</a></li>2181 <li>private cache <a href="#rfc.iref.p.1">1.1</a></li> 2184 2182 <li>proxy-revalidate (cache directive) <a href="#rfc.iref.p.4"><b>7.2.2.6</b></a></li> 2185 2183 <li>public (cache directive) <a href="#rfc.iref.p.2"><b>7.2.2.1</b></a></li> … … 2188 2186 <li><a id="rfc.index.R" href="#rfc.index.R"><b>R</b></a><ul> 2189 2187 <li><em>RFC1305</em> <a href="#rfc.xref.RFC1305.1">4.1.3</a>, <a href="#RFC1305"><b>12.2</b></a></li> 2190 <li><em>RFC2119</em> <a href="#rfc.xref.RFC2119.1">1. 3</a>, <a href="#RFC2119"><b>12.1</b></a></li>2188 <li><em>RFC2119</em> <a href="#rfc.xref.RFC2119.1">1.2</a>, <a href="#RFC2119"><b>12.1</b></a></li> 2191 2189 <li><em>RFC2616</em> <a href="#rfc.xref.RFC2616.1">4.1.2</a>, <a href="#RFC2616"><b>12.2</b></a><ul> 2192 2190 <li><em>Section 13.9</em> <a href="#rfc.xref.RFC2616.1">4.1.2</a></li> … … 2197 2195 </ul> 2198 2196 </li> 2199 <li><em>RFC5234</em> <a href="#rfc.xref.RFC5234.1">1. 4</a>, <a href="#RFC5234"><b>12.1</b></a>, <a href="#rfc.xref.RFC5234.2">B</a><ul>2197 <li><em>RFC5234</em> <a href="#rfc.xref.RFC5234.1">1.3</a>, <a href="#RFC5234"><b>12.1</b></a>, <a href="#rfc.xref.RFC5234.2">B</a><ul> 2200 2198 <li><em>Appendix B.1</em> <a href="#rfc.xref.RFC5234.2">B</a></li> 2201 2199 </ul> … … 2211 2209 <li><a id="rfc.index.S" href="#rfc.index.S"><b>S</b></a><ul> 2212 2210 <li>s-maxage (cache directive) <a href="#rfc.iref.s.4"><b>7.2.2.8</b></a></li> 2213 <li>shared cache <a href="#rfc.iref.s.1">1. 2</a></li>2214 <li>stale <a href="#rfc.iref.s.2">1. 2</a></li>2215 <li>strong validator <a href="#rfc.iref.s.3">1. 2</a></li>2211 <li>shared cache <a href="#rfc.iref.s.1">1.1</a></li> 2212 <li>stale <a href="#rfc.iref.s.2">1.1</a></li> 2213 <li>strong validator <a href="#rfc.iref.s.3">1.1</a></li> 2216 2214 </ul> 2217 2215 </li> 2218 2216 <li><a id="rfc.index.V" href="#rfc.index.V"><b>V</b></a><ul> 2219 <li>validator <a href="#rfc.iref.v.1">1. 2</a><ul>2220 <li>strong <a href="#rfc.iref.v.2">1. 2</a></li>2217 <li>validator <a href="#rfc.iref.v.1">1.1</a><ul> 2218 <li>strong <a href="#rfc.iref.v.2">1.1</a></li> 2221 2219 </ul> 2222 2220 </li>
Note: See TracChangeset
for help on using the changeset viewer.