Changeset 1260 for draft-ietf-httpbis/latest
- Timestamp:
- 05/04/11 22:49:27 (10 years ago)
- Location:
- draft-ietf-httpbis/latest
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
draft-ietf-httpbis/latest/p1-messaging.html
r1258 r1260 359 359 } 360 360 @bottom-center { 361 content: "Expires October 6, 2011";361 content: "Expires October 7, 2011"; 362 362 } 363 363 @bottom-right { … … 410 410 <meta name="dct.creator" content="Reschke, J. F."> 411 411 <meta name="dct.identifier" content="urn:ietf:id:draft-ietf-httpbis-p1-messaging-latest"> 412 <meta name="dct.issued" scheme="ISO8601" content="2011-04-0 4">412 <meta name="dct.issued" scheme="ISO8601" content="2011-04-05"> 413 413 <meta name="dct.replaces" content="urn:ietf:rfc:2145"> 414 414 <meta name="dct.replaces" content="urn:ietf:rfc:2616"> … … 442 442 </tr> 443 443 <tr> 444 <td class="left">Expires: October 6, 2011</td>444 <td class="left">Expires: October 7, 2011</td> 445 445 <td class="right">HP</td> 446 446 </tr> … … 495 495 <tr> 496 496 <td class="left"></td> 497 <td class="right">April 4, 2011</td>497 <td class="right">April 5, 2011</td> 498 498 </tr> 499 499 </tbody> … … 523 523 in progress”. 524 524 </p> 525 <p>This Internet-Draft will expire on October 6, 2011.</p>525 <p>This Internet-Draft will expire on October 7, 2011.</p> 526 526 <h1><a id="rfc.copyrightnotice" href="#rfc.copyrightnotice">Copyright Notice</a></h1> 527 527 <p>Copyright © 2011 IETF Trust and the persons identified as the document authors. All rights reserved.</p> -
draft-ietf-httpbis/latest/p2-semantics.html
r1257 r1260 359 359 } 360 360 @bottom-center { 361 content: "Expires October 6, 2011";361 content: "Expires October 7, 2011"; 362 362 } 363 363 @bottom-right { … … 409 409 <meta name="dct.creator" content="Reschke, J. F."> 410 410 <meta name="dct.identifier" content="urn:ietf:id:draft-ietf-httpbis-p2-semantics-latest"> 411 <meta name="dct.issued" scheme="ISO8601" content="2011-04-0 4">411 <meta name="dct.issued" scheme="ISO8601" content="2011-04-05"> 412 412 <meta name="dct.replaces" content="urn:ietf:rfc:2616"> 413 413 <meta name="dct.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 2 of the seven-part specification that defines the protocol referred to as "HTTP/1.1" and, taken together, obsoletes RFC 2616. Part 2 defines the semantics of HTTP messages as expressed by request methods, request header fields, response status codes, and response header fields."> … … 440 440 </tr> 441 441 <tr> 442 <td class="left">Expires: October 6, 2011</td>442 <td class="left">Expires: October 7, 2011</td> 443 443 <td class="right">HP</td> 444 444 </tr> … … 493 493 <tr> 494 494 <td class="left"></td> 495 <td class="right">April 4, 2011</td>495 <td class="right">April 5, 2011</td> 496 496 </tr> 497 497 </tbody> … … 520 520 in progress”. 521 521 </p> 522 <p>This Internet-Draft will expire on October 6, 2011.</p>522 <p>This Internet-Draft will expire on October 7, 2011.</p> 523 523 <h1><a id="rfc.copyrightnotice" href="#rfc.copyrightnotice">Copyright Notice</a></h1> 524 524 <p>Copyright © 2011 IETF Trust and the persons identified as the document authors. All rights reserved.</p> … … 1212 1212 <tr> 1213 1213 <td class="left">ETag</td> 1214 <td class="left"><a href="p4-conditional.html#header.etag" title="ETag">Section 2.2 .1</a> of <a href="#Part4" id="rfc.xref.Part4.8"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a></td>1214 <td class="left"><a href="p4-conditional.html#header.etag" title="ETag">Section 2.2</a> of <a href="#Part4" id="rfc.xref.Part4.8"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a></td> 1215 1215 </tr> 1216 1216 <tr> … … 1569 1569 </p> 1570 1570 <p id="rfc.section.8.2.2.p.2">A 201 response <em class="bcp14">MAY</em> contain an ETag response header field indicating the current value of the entity-tag for the representation of the resource 1571 just created (see <a href="p4-conditional.html#header.etag" title="ETag">Section 2.2 .1</a> of <a href="#Part4" id="rfc.xref.Part4.9"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>).1571 just created (see <a href="p4-conditional.html#header.etag" title="ETag">Section 2.2</a> of <a href="#Part4" id="rfc.xref.Part4.9"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>). 1572 1572 </p> 1573 1573 <div id="rfc.iref.26"></div> … … 3206 3206 </li> 3207 3207 <li><em>Part4</em> <a href="#rfc.xref.Part4.1">3</a>, <a href="#rfc.xref.Part4.2">3</a>, <a href="#rfc.xref.Part4.3">3</a>, <a href="#rfc.xref.Part4.4">3</a>, <a href="#rfc.xref.Part4.5">4.1</a>, <a href="#rfc.xref.Part4.6">4.1</a>, <a href="#rfc.xref.Part4.7">4.1</a>, <a href="#rfc.xref.Part4.8">5</a>, <a href="#rfc.xref.Part4.9">8.2.2</a>, <a href="#rfc.xref.Part4.10">8.3.5</a>, <a href="#rfc.xref.Part4.11">8.4.13</a>, <a href="#Part4"><b>13.1</b></a>, <a href="#rfc.xref.Part4.12">C.2</a><ul> 3208 <li><em>Section 2.2 .1</em> <a href="#rfc.xref.Part4.8">5</a>, <a href="#rfc.xref.Part4.9">8.2.2</a></li>3208 <li><em>Section 2.2</em> <a href="#rfc.xref.Part4.8">5</a>, <a href="#rfc.xref.Part4.9">8.2.2</a></li> 3209 3209 <li><em>Section 3.1</em> <a href="#rfc.xref.Part4.1">3</a></li> 3210 3210 <li><em>Section 3.2</em> <a href="#rfc.xref.Part4.3">3</a></li> -
draft-ietf-httpbis/latest/p3-payload.html
r1259 r1260 359 359 } 360 360 @bottom-center { 361 content: "Expires October 6, 2011";361 content: "Expires October 7, 2011"; 362 362 } 363 363 @bottom-right { … … 408 408 <meta name="dct.creator" content="Reschke, J. F."> 409 409 <meta name="dct.identifier" content="urn:ietf:id:draft-ietf-httpbis-p3-payload-latest"> 410 <meta name="dct.issued" scheme="ISO8601" content="2011-04-0 4">410 <meta name="dct.issued" scheme="ISO8601" content="2011-04-05"> 411 411 <meta name="dct.replaces" content="urn:ietf:rfc:2616"> 412 412 <meta name="dct.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 3 of the seven-part specification that defines the protocol referred to as "HTTP/1.1" and, taken together, obsoletes RFC 2616. Part 3 defines HTTP message content, metadata, and content negotiation."> … … 434 434 </tr> 435 435 <tr> 436 <td class="left">Expires: October 6, 2011</td>436 <td class="left">Expires: October 7, 2011</td> 437 437 <td class="right">J. Mogul</td> 438 438 </tr> … … 491 491 <tr> 492 492 <td class="left"></td> 493 <td class="right">April 4, 2011</td>493 <td class="right">April 5, 2011</td> 494 494 </tr> 495 495 </tbody> … … 517 517 in progress”. 518 518 </p> 519 <p>This Internet-Draft will expire on October 6, 2011.</p>519 <p>This Internet-Draft will expire on October 7, 2011.</p> 520 520 <h1><a id="rfc.copyrightnotice" href="#rfc.copyrightnotice">Copyright Notice</a></h1> 521 521 <p>Copyright © 2011 IETF Trust and the persons identified as the document authors. All rights reserved.</p> -
draft-ietf-httpbis/latest/p4-conditional.html
r1258 r1260 359 359 } 360 360 @bottom-center { 361 content: "Expires October 6, 2011";361 content: "Expires October 7, 2011"; 362 362 } 363 363 @bottom-right { … … 404 404 <meta name="dct.creator" content="Reschke, J. F."> 405 405 <meta name="dct.identifier" content="urn:ietf:id:draft-ietf-httpbis-p4-conditional-latest"> 406 <meta name="dct.issued" scheme="ISO8601" content="2011-04-0 4">406 <meta name="dct.issued" scheme="ISO8601" content="2011-04-05"> 407 407 <meta name="dct.replaces" content="urn:ietf:rfc:2616"> 408 408 <meta name="dct.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 4 of the seven-part specification that defines the protocol referred to as "HTTP/1.1" and, taken together, obsoletes RFC 2616. Part 4 defines request header fields for indicating conditional requests and the rules for constructing responses to those requests."> … … 430 430 </tr> 431 431 <tr> 432 <td class="left">Expires: October 6, 2011</td>432 <td class="left">Expires: October 7, 2011</td> 433 433 <td class="right">J. Mogul</td> 434 434 </tr> … … 487 487 <tr> 488 488 <td class="left"></td> 489 <td class="right">April 4, 2011</td>489 <td class="right">April 5, 2011</td> 490 490 </tr> 491 491 </tbody> … … 513 513 in progress”. 514 514 </p> 515 <p>This Internet-Draft will expire on October 6, 2011.</p>515 <p>This Internet-Draft will expire on October 7, 2011.</p> 516 516 <h1><a id="rfc.copyrightnotice" href="#rfc.copyrightnotice">Copyright Notice</a></h1> 517 517 <p>Copyright © 2011 IETF Trust and the persons identified as the document authors. All rights reserved.</p> … … 537 537 </li> 538 538 <li>2. <a href="#resource.metadata">Resource State Metadata (Validators)</a><ul> 539 <li>2.1 <a href="#header.last-modified">Last-Modified</a></li> 540 <li>2.2 <a href="#entity.tags">Entity Tags</a><ul> 541 <li>2.2.1 <a href="#header.etag">ETag</a></li> 542 <li>2.2.2 <a href="#example.entity.tag.vs.conneg">Example: Entity-tags varying on Content-Negotiated Resources</a></li> 539 <li>2.1 <a href="#header.last-modified">Last-Modified</a><ul> 540 <li>2.1.1 <a href="#lastmod.generation">Generation</a></li> 541 <li>2.1.2 <a href="#lastmod.comparison">Comparison</a></li> 543 542 </ul> 544 543 </li> 545 <li>2.3 <a href="#weak.and.strong.validators">Weak and Strong Validators</a></li> 546 <li>2.4 <a href="#rules.for.when.to.use.entity.tags.and.last-modified.dates">Rules for When to Use Entity-tags and Last-Modified Dates</a></li> 544 <li>2.2 <a href="#header.etag">ETag</a><ul> 545 <li>2.2.1 <a href="#entity.tag.generation">Generation</a></li> 546 <li>2.2.2 <a href="#weak.and.strong.validators">Weak versus Strong</a></li> 547 <li>2.2.3 <a href="#entity.tag.comparison">Comparison</a></li> 548 <li>2.2.4 <a href="#rules.for.when.to.use.entity.tags.and.last-modified.dates">Rules for When to Use Entity-tags and Last-Modified Dates</a></li> 549 <li>2.2.5 <a href="#example.entity.tag.vs.conneg">Example: Entity-tags varying on Content-Negotiated Resources</a></li> 550 </ul> 551 </li> 547 552 </ul> 548 553 </li> … … 552 557 <li>3.3 <a href="#header.if-modified-since">If-Modified-Since</a></li> 553 558 <li>3.4 <a href="#header.if-unmodified-since">If-Unmodified-Since</a></li> 559 <li>3.5 <a href="#header.if-range">If-Range</a></li> 554 560 </ul> 555 561 </li> … … 597 603 <p id="rfc.section.1.p.1">This document defines the HTTP/1.1 conditional request mechanisms, including both response metadata that can be used to indicate 598 604 or observe changes to resource state and request header fields that specify preconditions to be checked before performing 599 the action given by the request method. Conditional GET requests are the most efficient mechanism for HTTP cache updates <a href="#Part6" id="rfc.xref.Part6.1"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>. Conditionals can be applied to state-changing methods, such as PUT and DELETE, to prevent the "lost update" problem: one600 client accidentally overwriting the work of another client that has been acting in parallel.605 the action given by the request method. Conditional GET requests are the most efficient mechanism for HTTP cache updates <a href="#Part6" id="rfc.xref.Part6.1"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>. Conditionals can also be applied to state-changing methods, such as PUT and DELETE, to prevent the "lost update" problem: 606 one client accidentally overwriting the work of another client that has been acting in parallel. 601 607 </p> 602 608 <p id="rfc.section.1.p.2">Conditional request preconditions are based on the state of the target resource as a whole (its current value set) or the … … 637 643 <p id="rfc.section.2.p.1">This specification defines two forms of metadata that are commonly used to observe resource state and test for preconditions: 638 644 modification dates and opaque entity tags. Additional metadata that reflects resource state has been defined by various extensions 639 of HTTP, such as WebDAV <a href="#RFC4918" id="rfc.xref.RFC4918.1"><cite title="HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)">[RFC4918]</cite></a>, that are beyond the scope of this specification. Such metadatais referred to as a "<dfn>validator</dfn>" when it is used within a precondition.645 of HTTP, such as WebDAV <a href="#RFC4918" id="rfc.xref.RFC4918.1"><cite title="HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)">[RFC4918]</cite></a>, that are beyond the scope of this specification. A resource metadata value is referred to as a "<dfn>validator</dfn>" when it is used within a precondition. 640 646 </p> 641 647 <div id="rfc.iref.l.1"></div> 642 648 <div id="rfc.iref.h.1"></div> 643 649 <h2 id="rfc.section.2.1"><a href="#rfc.section.2.1">2.1</a> <a id="header.last-modified" href="#header.last-modified">Last-Modified</a></h2> 644 <p id="rfc.section.2.1.p.1">The "Last-Modified" header field indicates the date and time at which the origin server believes the representation was last645 modified.650 <p id="rfc.section.2.1.p.1">The "Last-Modified" header field indicates the date and time at which the origin server believes the selected representation 651 was last modified. 646 652 </p> 647 653 <div id="rfc.figure.u.2"></div><pre class="inline"><span id="rfc.iref.g.1"></span> <a href="#header.last-modified" class="smpl">Last-Modified</a> = <a href="#notation" class="smpl">HTTP-date</a> 648 654 </pre><p id="rfc.section.2.1.p.3">An example of its use is</p> 649 655 <div id="rfc.figure.u.3"></div><pre class="text"> Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT 650 </pre><p id="rfc.section.2.1.p.5">A representation is typically the sum of many parts behind the resource interface. The last-modified time would usually be 656 </pre><h3 id="rfc.section.2.1.1"><a href="#rfc.section.2.1.1">2.1.1</a> <a id="lastmod.generation" href="#lastmod.generation">Generation</a></h3> 657 <p id="rfc.section.2.1.1.p.1">Origin servers <em class="bcp14">SHOULD</em> send Last-Modified for any selected representation for which a last modification date can be reasonably and consistently determined, 658 since its use in conditional requests and evaluating cache freshness (<a href="#Part6" id="rfc.xref.Part6.2"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>) results in a substantial reduction of HTTP traffic on the Internet and can be a significant factor in improving service 659 scalability and reliability. 660 </p> 661 <p id="rfc.section.2.1.1.p.2">A representation is typically the sum of many parts behind the resource interface. The last-modified time would usually be 651 662 the most recent time that any of those parts were changed. How that value is determined for any given resource is an implementation 652 663 detail beyond the scope of this specification. What matters to HTTP is how recipients of the Last-Modified header field can 653 664 use its value to make conditional requests and test the validity of locally cached responses. 654 665 </p> 655 <p id="rfc.section.2.1.p.6">An origin server <em class="bcp14">MUST NOT</em> send a Last-Modified date which is later than the server's time of message origination. In such cases, where the resource's 656 last modification would indicate some time in the future, the server <em class="bcp14">MUST</em> replace that date with the message origination date. 657 </p> 658 <p id="rfc.section.2.1.p.7">An origin server <em class="bcp14">SHOULD</em> obtain the Last-Modified value of the representation as close as possible to the time that it generates the Date value of 659 its response. This allows a recipient to make an accurate assessment of the representation's modification time, especially 666 <p id="rfc.section.2.1.1.p.3">An origin server <em class="bcp14">SHOULD</em> obtain the Last-Modified value of the representation as close as possible to the time that it generates the Date field-value 667 for its response. This allows a recipient to make an accurate assessment of the representation's modification time, especially 660 668 if the representation changes near the time that the response is generated. 661 669 </p> 662 <p id="rfc.section.2.1.p.8">HTTP/1.1 servers <em class="bcp14">SHOULD</em> send Last-Modified whenever feasible. 663 </p> 664 <p id="rfc.section.2.1.p.9">The Last-Modified header field value is often used as a cache validator. In simple terms, a cache entry is considered to be 665 valid if the representation has not been modified since the Last-Modified value. 666 </p> 667 <h2 id="rfc.section.2.2"><a href="#rfc.section.2.2">2.2</a> <a id="entity.tags" href="#entity.tags">Entity Tags</a></h2> 668 <p id="rfc.section.2.2.p.1">Entity-tags are used for comparing two or more representations of the same resource. HTTP/1.1 uses entity-tags in the ETag 669 (<a href="#header.etag" id="rfc.xref.header.etag.1" title="ETag">Section 2.2.1</a>), If-Match (<a href="#header.if-match" id="rfc.xref.header.if-match.1" title="If-Match">Section 3.1</a>), If-None-Match (<a href="#header.if-none-match" id="rfc.xref.header.if-none-match.1" title="If-None-Match">Section 3.2</a>), and If-Range (<a href="p5-range.html#header.if-range" title="If-Range">Section 5.3</a> of <a href="#Part5" id="rfc.xref.Part5.1"><cite title="HTTP/1.1, part 5: Range Requests and Partial Responses">[Part5]</cite></a>) header fields. The definition of how they are used and compared as cache validators is in <a href="#weak.and.strong.validators" title="Weak and Strong Validators">Section 2.3</a>. An entity-tag consists of an opaque quoted string, possibly prefixed by a weakness indicator. 670 </p> 671 <div id="rfc.figure.u.4"></div><pre class="inline"><span id="rfc.iref.g.2"></span><span id="rfc.iref.g.3"></span><span id="rfc.iref.g.4"></span> <a href="#entity.tags" class="smpl">entity-tag</a> = [ <a href="#entity.tags" class="smpl">weak</a> ] <a href="#entity.tags" class="smpl">opaque-tag</a> 672 <a href="#entity.tags" class="smpl">weak</a> = %x57.2F ; "W/", case-sensitive 673 <a href="#entity.tags" class="smpl">opaque-tag</a> = <a href="#notation" class="smpl">quoted-string</a> 674 </pre><p id="rfc.section.2.2.p.3">A "strong entity-tag" <em class="bcp14">MAY</em> be shared by two representations of a resource only if they are equivalent by octet equality. 675 </p> 676 <p id="rfc.section.2.2.p.4">A "weak entity-tag", indicated by the "W/" prefix, <em class="bcp14">MAY</em> be shared by two representations of a resource. A weak entity-tag can only be used for weak comparison. 677 </p> 678 <p id="rfc.section.2.2.p.5">Cache entries might persist for arbitrarily long periods, regardless of expiration times, so it is inappropriate to expect 679 that a cache will never again attempt to validate an entry using a validator that it obtained at some point in the past. A 680 strong entity-tag <em class="bcp14">MUST</em> be unique across all versions of all representations associated with a particular resource over time. However, there is no 681 implication of uniqueness across entity-tags of different resources (i.e., the same entity-tag value might be in use for representations 682 of multiple resources at the same time and does not imply that those representations are equivalent). 670 <p id="rfc.section.2.1.1.p.4">An origin server with a clock <em class="bcp14">MUST NOT</em> send a Last-Modified date that is later than the server's time of message origination (Date). If the last modification time 671 is derived from implementation-specific metadata that evaluates to some time in the future, according to the origin server's 672 clock, then the origin server <em class="bcp14">MUST</em> replace that value with the message origination date. This prevents a future modification date from having an adverse impact 673 on cache validation. 674 </p> 675 <h3 id="rfc.section.2.1.2"><a href="#rfc.section.2.1.2">2.1.2</a> <a id="lastmod.comparison" href="#lastmod.comparison">Comparison</a></h3> 676 <p id="rfc.section.2.1.2.p.1">A Last-Modified time, when used as a validator in a request, is implicitly weak unless it is possible to deduce that it is 677 strong, using the following rules: 678 </p> 679 <ul> 680 <li>The validator is being compared by an origin server to the actual current validator for the representation and,</li> 681 <li>That origin server reliably knows that the associated representation did not change twice during the second covered by the 682 presented validator. 683 </li> 684 </ul> 685 <p id="rfc.section.2.1.2.p.2">or </p> 686 <ul> 687 <li>The validator is about to be used by a client in an If-Modified-Since or If-Unmodified-Since header field, because the client 688 has a cache entry for the associated representation, and 689 </li> 690 <li>That cache entry includes a Date value, which gives the time when the origin server sent the original response, and</li> 691 <li>The presented Last-Modified time is at least 60 seconds before the Date value.</li> 692 </ul> 693 <p id="rfc.section.2.1.2.p.3">or </p> 694 <ul> 695 <li>The validator is being compared by an intermediate cache to the validator stored in its cache entry for the representation, 696 and 697 </li> 698 <li>That cache entry includes a Date value, which gives the time when the origin server sent the original response, and</li> 699 <li>The presented Last-Modified time is at least 60 seconds before the Date value.</li> 700 </ul> 701 <p id="rfc.section.2.1.2.p.4">This method relies on the fact that if two different responses were sent by the origin server during the same second, but 702 both had the same Last-Modified time, then at least one of those responses would have a Date value equal to its Last-Modified 703 time. The arbitrary 60-second limit guards against the possibility that the Date and Last-Modified values are generated from 704 different clocks, or at somewhat different times during the preparation of the response. An implementation <em class="bcp14">MAY</em> use a value larger than 60 seconds, if it is believed that 60 seconds is too short. 683 705 </p> 684 706 <div id="rfc.iref.e.1"></div> 685 707 <div id="rfc.iref.h.2"></div> 686 <h3 id="rfc.section.2.2.1"><a href="#rfc.section.2.2.1">2.2.1</a> <a id="header.etag" href="#header.etag">ETag</a></h3> 687 <p id="rfc.section.2.2.1.p.1">The "ETag" header field provides the current value of the entity-tag (see <a href="#entity.tags" title="Entity Tags">Section 2.2</a>) for one representation of the target resource. An entity-tag is intended for use as a resource-local identifier for differentiating 688 between representations of the same resource that vary over time or via content negotiation (see <a href="#weak.and.strong.validators" title="Weak and Strong Validators">Section 2.3</a>). 689 </p> 690 <div id="rfc.figure.u.5"></div><pre class="inline"><span id="rfc.iref.g.5"></span> <a href="#header.etag" class="smpl">ETag</a> = <a href="#entity.tags" class="smpl">entity-tag</a> 691 </pre><div id="rfc.figure.u.6"></div> 708 <h2 id="rfc.section.2.2"><a href="#rfc.section.2.2">2.2</a> <a id="header.etag" href="#header.etag">ETag</a></h2> 709 <p id="rfc.section.2.2.p.1">The ETag header field provides the current entity-tag for the selected representation. An entity-tag is an opaque validator 710 for differentiating between multiple representations of the same resource, regardless of whether those multiple representations 711 are due to resource state changes over time, content negotiation resulting in multiple representations being valid at the 712 same time, or both. An entity-tag consists of an opaque quoted string, possibly prefixed by a weakness indicator. 713 </p> 714 <div id="rfc.figure.u.4"></div><pre class="inline"><span id="rfc.iref.g.2"></span><span id="rfc.iref.g.3"></span><span id="rfc.iref.g.4"></span><span id="rfc.iref.g.5"></span> <a href="#header.etag" class="smpl">ETag</a> = <a href="#header.etag" class="smpl">entity-tag</a> 715 716 <a href="#header.etag" class="smpl">entity-tag</a> = [ <a href="#header.etag" class="smpl">weak</a> ] <a href="#header.etag" class="smpl">opaque-tag</a> 717 <a href="#header.etag" class="smpl">weak</a> = %x57.2F ; "W/", case-sensitive 718 <a href="#header.etag" class="smpl">opaque-tag</a> = <a href="#notation" class="smpl">quoted-string</a> 719 </pre><p id="rfc.section.2.2.p.3">An entity-tag can be more reliable for validation than a modification date in situations where it is inconvenient to store 720 modification dates, where the one-second resolution of HTTP date values is not sufficient, or where modification dates are 721 not consistently maintained. 722 </p> 723 <div id="rfc.figure.u.5"></div> 692 724 <p>Examples:</p> <pre class="text"> ETag: "xyzzy" 693 725 ETag: W/"xyzzy" 694 726 ETag: "" 695 </pre><p id="rfc.section.2.2.1.p.4">An entity-tag provides an "opaque" cache validator that allows for more reliable validation than modification dates in situations 696 where it is inconvenient to store modification dates, where the one-second resolution of HTTP date values is not sufficient, 697 or where the origin server wishes to avoid certain paradoxes that might arise from the use of modification dates. 698 </p> 699 <p id="rfc.section.2.2.1.p.5">The principle behind entity-tags is that only the service author knows the semantics of a resource well enough to select an 700 appropriate cache validation mechanism, and the specification of any validator comparison function more complex than byte-equality 701 would open up a can of worms. Thus, comparisons of any other header fields (except Last-Modified, for compatibility with HTTP/1.0) 702 are never used for purposes of validating a cache entry. 703 </p> 704 <h3 id="rfc.section.2.2.2"><a href="#rfc.section.2.2.2">2.2.2</a> <a id="example.entity.tag.vs.conneg" href="#example.entity.tag.vs.conneg">Example: Entity-tags varying on Content-Negotiated Resources</a></h3> 705 <p id="rfc.section.2.2.2.p.1">Consider a resource that is subject to content negotiation (<a href="p3-payload.html#content.negotiation" title="Content Negotiation">Section 5</a> of <a href="#Part3" id="rfc.xref.Part3.1"><cite title="HTTP/1.1, part 3: Message Payload and Content Negotiation">[Part3]</cite></a>), and where the representations returned upon a GET request vary based on the Accept-Encoding request header field (<a href="p3-payload.html#header.accept-encoding" title="Accept-Encoding">Section 6.3</a> of <a href="#Part3" id="rfc.xref.Part3.2"><cite title="HTTP/1.1, part 3: Message Payload and Content Negotiation">[Part3]</cite></a>): 706 </p> 707 <div id="rfc.figure.u.7"></div> 708 <p>>> Request:</p><pre class="text2">GET /index HTTP/1.1 709 Host: www.example.com 710 Accept-Encoding: gzip 711 712 </pre><p id="rfc.section.2.2.2.p.3">In this case, the response might or might not use the gzip content coding. If it does not, the response might look like:</p> 713 <div id="rfc.figure.u.8"></div> 714 <p>>> Response:</p><pre class="text">HTTP/1.1 200 OK 715 Date: Thu, 26 Mar 2010 00:05:00 GMT 716 ETag: "123-a" 717 Content-Length: 70 718 Vary: Accept-Encoding 719 Content-Type: text/plain 720 721 <span id="exbody">Hello World! 722 Hello World! 723 Hello World! 724 Hello World! 725 Hello World! 726 </span></pre><p id="rfc.section.2.2.2.p.5">An alternative representation that does use gzip content coding would be:</p> 727 <div id="rfc.figure.u.9"></div> 728 <p>>> Response:</p><pre class="text">HTTP/1.1 200 OK 729 Date: Thu, 26 Mar 2010 00:05:00 GMT 730 ETag: "123-b" 731 Content-Length: 43 732 Vary: Accept-Encoding 733 Content-Type: text/plain 734 Content-Encoding: gzip 735 736 <em>...binary data...</em></pre><div class="note" id="rfc.section.2.2.2.p.7"> 737 <p> <b>Note:</b> Content codings are a property of the representation, so therefore an entity-tag of an encoded representation must be distinct 738 from an unencoded representation to prevent conflicts during cache updates and range requests. In contrast, transfer codings 739 (<a href="p1-messaging.html#transfer.codings" title="Transfer Codings">Section 6.2</a> of <a href="#Part1" id="rfc.xref.Part1.5"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>) apply only during message transfer and do not require distinct entity-tags. 740 </p> 741 </div> 742 <h2 id="rfc.section.2.3"><a href="#rfc.section.2.3">2.3</a> <a id="weak.and.strong.validators" href="#weak.and.strong.validators">Weak and Strong Validators</a></h2> 743 <p id="rfc.section.2.3.p.1">Since both origin servers and caches will compare two validators to decide if they represent the same or different representations, 727 </pre><h3 id="rfc.section.2.2.1"><a href="#rfc.section.2.2.1">2.2.1</a> <a id="entity.tag.generation" href="#entity.tag.generation">Generation</a></h3> 728 <p id="rfc.section.2.2.1.p.1">The principle behind entity-tags is that only the service author knows the implementation of a resource well enough to select 729 the most accurate and efficient validation mechanism for that resource, and that any such mechanism can be mapped to a simple 730 sequence of octets for easy comparison. Since the value is opaque, there is no need for the client to be aware of how each 731 entity-tag is constructed. 732 </p> 733 <p id="rfc.section.2.2.1.p.2">For example, a resource that has implementation-specific versioning applied to all changes might use an internal revision 734 number, perhaps combined with a variance identifier for content negotiation, to accurately differentiate between representations. 735 Other implementations might use a stored hash of representation content, a combination of various filesystem attributes, or 736 a modification timestamp that has sub-second resolution. 737 </p> 738 <p id="rfc.section.2.2.1.p.3">Origin servers <em class="bcp14">SHOULD</em> send ETag for any selected representation for which detection of changes can be reasonably and consistently determined, since 739 the entity-tag's use in conditional requests and evaluating cache freshness (<a href="#Part6" id="rfc.xref.Part6.3"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>) can result in a substantial reduction of HTTP network traffic and can be a significant factor in improving service scalability 740 and reliability. 741 </p> 742 <h3 id="rfc.section.2.2.2"><a href="#rfc.section.2.2.2">2.2.2</a> <a id="weak.and.strong.validators" href="#weak.and.strong.validators">Weak versus Strong</a></h3> 743 <p id="rfc.section.2.2.2.p.1">Since both origin servers and caches will compare two validators to decide if they indicate the same or different representations, 744 744 one normally would expect that if the representation (including both representation header fields and representation body) 745 changes in any way, then the associated validator would change as well. If this is true, then we call th isvalidator a "strong745 changes in any way, then the associated validator would change as well. If this is true, then we call that validator a "strong 746 746 validator". One example of a strong validator is an integer that is incremented in stable storage every time a representation 747 747 is changed. 748 748 </p> 749 <p id="rfc.section.2. 3.p.2">However, there might be cases when a server prefers to change the validator only when it desires cached representations to749 <p id="rfc.section.2.2.2.p.2">However, there might be cases when a server prefers to change the validator only when it desires cached representations to 750 750 be invalidated. For example, the representation of a weather report that changes in content every second, based on dynamic 751 751 measurements, might be grouped into sets of equivalent representations (from the origin server's perspective) in order to … … 753 753 or weather quality). A validator that does not always change when the representation changes is a "weak validator". 754 754 </p> 755 <p id="rfc.section.2. 3.p.3">An entity-tag is normally a strong validator, but the protocol provides a mechanism to tag an entity-tag as "weak". One can756 think of a strong validator as part of an identifier for a specific representation, whereas a weak validator is part of an757 identifier for a set of equivalent representations (where this notion of equivalence is entirely governed by the origin server758 and beyond the scope of this specification).759 < /p>755 <p id="rfc.section.2.2.2.p.3">One can think of a strong validator as part of an identifier for a specific representation, whereas a weak validator is part 756 of an identifier for a set of equivalent representations (where this notion of equivalence is entirely governed by the origin 757 server and beyond the scope of this specification). 758 </p> 759 <p id="rfc.section.2.2.2.p.4">An entity-tag is normally a strong validator, but the protocol provides a mechanism to tag an entity-tag as "weak". </p> 760 760 <ul class="empty"> 761 761 <li>A representation's modification time, if defined with only one-second resolution, could be a weak validator, since it is possible … … 767 767 </li> 768 768 </ul> 769 <p id="rfc.section.2. 3.p.4">A strong entity-tag <em class="bcp14">MUST</em> change whenever the associated representation changes in any way. A weak entity-tag <em class="bcp14">SHOULD</em> change whenever the origin server considers prior representations to be unacceptable as a substitute for the current representation.769 <p id="rfc.section.2.2.2.p.5">A strong entity-tag <em class="bcp14">MUST</em> change whenever the associated representation changes in any way. A weak entity-tag <em class="bcp14">SHOULD</em> change whenever the origin server considers prior representations to be unacceptable as a substitute for the current representation. 770 770 In other words, a weak entity tag <em class="bcp14">SHOULD</em> change whenever the origin server wants caches to invalidate old responses. 771 771 </p> 772 <p id="rfc.section.2.3.p.5">A "use" of a validator is either when a client generates a request and includes the validator in a validating header field, 773 or when a server compares two validators. 774 </p> 775 <p id="rfc.section.2.3.p.6">Strong validators are usable in any context. Weak validators are only usable in contexts that do not depend on exact equality 776 of a representation. For example, either kind is usable for a normal conditional GET. However, only a strong validator is 777 usable for range retrieval (<a href="#Part5" id="rfc.xref.Part5.2"><cite title="HTTP/1.1, part 5: Range Requests and Partial Responses">[Part5]</cite></a>), since otherwise the client might end up with an internally inconsistent representation. Clients <em class="bcp14">MUST NOT</em> use weak validators in range requests. 778 </p> 779 <p id="rfc.section.2.3.p.7">The only function that HTTP/1.1 defines on validators is comparison. There are two validator comparison functions, depending 780 on whether the comparison context allows the use of weak validators or not: 772 <p id="rfc.section.2.2.2.p.6">A "strong entity-tag" <em class="bcp14">MAY</em> be shared by two representations of a resource only if they are equivalent by octet equality. 773 </p> 774 <p id="rfc.section.2.2.2.p.7">A "weak entity-tag", indicated by the "W/" prefix, <em class="bcp14">MAY</em> be shared by two representations of a resource. A weak entity-tag can only be used for weak comparison. 775 </p> 776 <p id="rfc.section.2.2.2.p.8">Cache entries might persist for arbitrarily long periods, regardless of expiration times. Thus, a cache might attempt to validate 777 an entry using a validator that it obtained in the distant past. A strong entity-tag <em class="bcp14">MUST</em> be unique across all versions of all representations associated with a particular resource over time. However, there is no 778 implication of uniqueness across entity-tags of different resources (i.e., the same entity-tag value might be in use for representations 779 of multiple resources at the same time and does not imply that those representations are equivalent). 780 </p> 781 <h3 id="rfc.section.2.2.3"><a href="#rfc.section.2.2.3">2.2.3</a> <a id="entity.tag.comparison" href="#entity.tag.comparison">Comparison</a></h3> 782 <p id="rfc.section.2.2.3.p.1">There are two entity-tag comparison functions, depending on whether the comparison context allows the use of weak validators 783 or not: 781 784 </p> 782 785 <ul> … … 786 789 </li> 787 790 </ul> 788 <p id="rfc.section.2.3.p.8">The example below shows the results for a set of entity-tag pairs, and both the weak and strong comparison function results:</p> 791 <p id="rfc.section.2.2.3.p.2">A "use" of a validator is either when a client generates a request and includes the validator in a precondition, or when a 792 server compares two validators. 793 </p> 794 <p id="rfc.section.2.2.3.p.3">Strong validators are usable in any context. Weak validators are only usable in contexts that do not depend on exact equality 795 of a representation. For example, either kind is usable for a normal conditional GET. 796 </p> 797 <p id="rfc.section.2.2.3.p.4">The example below shows the results for a set of entity-tag pairs, and both the weak and strong comparison function results:</p> 789 798 <div id="rfc.table.u.1"> 790 799 <table class="tt full left" cellpadding="3" cellspacing="0"> … … 825 834 </table> 826 835 </div> 827 <p id="rfc.section.2.3.p.9">An entity-tag is strong unless it is explicitly tagged as weak. <a href="#entity.tags" title="Entity Tags">Section 2.2</a> gives the syntax for entity-tags. 828 </p> 829 <p id="rfc.section.2.3.p.10">A Last-Modified time, when used as a validator in a request, is implicitly weak unless it is possible to deduce that it is 830 strong, using the following rules: 831 </p> 832 <ul> 833 <li>The validator is being compared by an origin server to the actual current validator for the representation and,</li> 834 <li>That origin server reliably knows that the associated representation did not change twice during the second covered by the 835 presented validator. 836 </li> 837 </ul> 838 <p id="rfc.section.2.3.p.11">or </p> 839 <ul> 840 <li>The validator is about to be used by a client in an If-Modified-Since or If-Unmodified-Since header field, because the client 841 has a cache entry for the associated representation, and 842 </li> 843 <li>That cache entry includes a Date value, which gives the time when the origin server sent the original response, and</li> 844 <li>The presented Last-Modified time is at least 60 seconds before the Date value.</li> 845 </ul> 846 <p id="rfc.section.2.3.p.12">or </p> 847 <ul> 848 <li>The validator is being compared by an intermediate cache to the validator stored in its cache entry for the representation, 849 and 850 </li> 851 <li>That cache entry includes a Date value, which gives the time when the origin server sent the original response, and</li> 852 <li>The presented Last-Modified time is at least 60 seconds before the Date value.</li> 853 </ul> 854 <p id="rfc.section.2.3.p.13">This method relies on the fact that if two different responses were sent by the origin server during the same second, but 855 both had the same Last-Modified time, then at least one of those responses would have a Date value equal to its Last-Modified 856 time. The arbitrary 60-second limit guards against the possibility that the Date and Last-Modified values are generated from 857 different clocks, or at somewhat different times during the preparation of the response. An implementation <em class="bcp14">MAY</em> use a value larger than 60 seconds, if it is believed that 60 seconds is too short. 858 </p> 859 <p id="rfc.section.2.3.p.14">If a client wishes to perform a sub-range retrieval on a value for which it has only a Last-Modified time and no opaque validator, 860 it <em class="bcp14">MAY</em> do this only if the Last-Modified time is strong in the sense described here. 861 </p> 862 <p id="rfc.section.2.3.p.15">A cache or origin server receiving a conditional range request (<a href="#Part5" id="rfc.xref.Part5.3"><cite title="HTTP/1.1, part 5: Range Requests and Partial Responses">[Part5]</cite></a>) <em class="bcp14">MUST</em> use the strong comparison function to evaluate the condition. 863 </p> 864 <p id="rfc.section.2.3.p.16">These rules allow HTTP/1.1 caches and clients to safely perform sub-range retrievals on values that have been obtained from 865 HTTP/1.0 servers. 866 </p> 867 <h2 id="rfc.section.2.4"><a href="#rfc.section.2.4">2.4</a> <a id="rules.for.when.to.use.entity.tags.and.last-modified.dates" href="#rules.for.when.to.use.entity.tags.and.last-modified.dates">Rules for When to Use Entity-tags and Last-Modified Dates</a></h2> 868 <p id="rfc.section.2.4.p.1">We adopt a set of rules and recommendations for origin servers, clients, and caches regarding when various validator types 836 <p id="rfc.section.2.2.3.p.5">An entity-tag is strong unless it is explicitly tagged as weak.</p> 837 <h3 id="rfc.section.2.2.4"><a href="#rfc.section.2.2.4">2.2.4</a> <a id="rules.for.when.to.use.entity.tags.and.last-modified.dates" href="#rules.for.when.to.use.entity.tags.and.last-modified.dates">Rules for When to Use Entity-tags and Last-Modified Dates</a></h3> 838 <p id="rfc.section.2.2.4.p.1">We adopt a set of rules and recommendations for origin servers, clients, and caches regarding when various validator types 869 839 ought to be used, and for what purposes. 870 840 </p> 871 <p id="rfc.section.2. 4.p.2">HTTP/1.1 origin servers: </p>841 <p id="rfc.section.2.2.4.p.2">HTTP/1.1 origin servers: </p> 872 842 <ul> 873 843 <li><em class="bcp14">SHOULD</em> send an entity-tag validator unless it is not feasible to generate one. … … 879 849 </li> 880 850 </ul> 881 <p id="rfc.section.2. 4.p.3">In other words, the preferred behavior for an HTTP/1.1 origin server is to send both a strong entity-tag and a Last-Modified851 <p id="rfc.section.2.2.4.p.3">In other words, the preferred behavior for an HTTP/1.1 origin server is to send both a strong entity-tag and a Last-Modified 882 852 value. 883 853 </p> 884 <p id="rfc.section.2. 4.p.4">HTTP/1.1 clients: </p>854 <p id="rfc.section.2.2.4.p.4">HTTP/1.1 clients: </p> 885 855 <ul> 886 856 <li><em class="bcp14">MUST</em> use that entity-tag in any cache-conditional request (using If-Match or If-None-Match) if an entity-tag has been provided … … 897 867 </li> 898 868 </ul> 899 <p id="rfc.section.2. 4.p.5">An HTTP/1.1 origin server, upon receiving a conditional request that includes both a Last-Modified date (e.g., in an If-Modified-Since869 <p id="rfc.section.2.2.4.p.5">An HTTP/1.1 origin server, upon receiving a conditional request that includes both a Last-Modified date (e.g., in an If-Modified-Since 900 870 or If-Unmodified-Since header field) and one or more entity-tags (e.g., in an If-Match, If-None-Match, or If-Range header 901 871 field) as cache validators, <em class="bcp14">MUST NOT</em> return a response status code of 304 (Not Modified) unless doing so is consistent with all of the conditional header fields 902 872 in the request. 903 873 </p> 904 <p id="rfc.section.2. 4.p.6">An HTTP/1.1 caching proxy, upon receiving a conditional request that includes both a Last-Modified date and one or more entity-tags874 <p id="rfc.section.2.2.4.p.6">An HTTP/1.1 caching proxy, upon receiving a conditional request that includes both a Last-Modified date and one or more entity-tags 905 875 as cache validators, <em class="bcp14">MUST NOT</em> return a locally cached response to the client unless that cached response is consistent with all of the conditional header 906 876 fields in the request. … … 917 887 </li> 918 888 </ul> 889 <h3 id="rfc.section.2.2.5"><a href="#rfc.section.2.2.5">2.2.5</a> <a id="example.entity.tag.vs.conneg" href="#example.entity.tag.vs.conneg">Example: Entity-tags varying on Content-Negotiated Resources</a></h3> 890 <p id="rfc.section.2.2.5.p.1">Consider a resource that is subject to content negotiation (<a href="p3-payload.html#content.negotiation" title="Content Negotiation">Section 5</a> of <a href="#Part3" id="rfc.xref.Part3.1"><cite title="HTTP/1.1, part 3: Message Payload and Content Negotiation">[Part3]</cite></a>), and where the representations returned upon a GET request vary based on the Accept-Encoding request header field (<a href="p3-payload.html#header.accept-encoding" title="Accept-Encoding">Section 6.3</a> of <a href="#Part3" id="rfc.xref.Part3.2"><cite title="HTTP/1.1, part 3: Message Payload and Content Negotiation">[Part3]</cite></a>): 891 </p> 892 <div id="rfc.figure.u.6"></div> 893 <p>>> Request:</p><pre class="text2">GET /index HTTP/1.1 894 Host: www.example.com 895 Accept-Encoding: gzip 896 897 </pre><p id="rfc.section.2.2.5.p.3">In this case, the response might or might not use the gzip content coding. If it does not, the response might look like:</p> 898 <div id="rfc.figure.u.7"></div> 899 <p>>> Response:</p><pre class="text">HTTP/1.1 200 OK 900 Date: Thu, 26 Mar 2010 00:05:00 GMT 901 ETag: "123-a" 902 Content-Length: 70 903 Vary: Accept-Encoding 904 Content-Type: text/plain 905 906 <span id="exbody">Hello World! 907 Hello World! 908 Hello World! 909 Hello World! 910 Hello World! 911 </span></pre><p id="rfc.section.2.2.5.p.5">An alternative representation that does use gzip content coding would be:</p> 912 <div id="rfc.figure.u.8"></div> 913 <p>>> Response:</p><pre class="text">HTTP/1.1 200 OK 914 Date: Thu, 26 Mar 2010 00:05:00 GMT 915 ETag: "123-b" 916 Content-Length: 43 917 Vary: Accept-Encoding 918 Content-Type: text/plain 919 Content-Encoding: gzip 920 921 <em>...binary data...</em></pre><div class="note" id="rfc.section.2.2.5.p.7"> 922 <p> <b>Note:</b> Content codings are a property of the representation, so therefore an entity-tag of an encoded representation must be distinct 923 from an unencoded representation to prevent conflicts during cache updates and range requests. In contrast, transfer codings 924 (<a href="p1-messaging.html#transfer.codings" title="Transfer Codings">Section 6.2</a> of <a href="#Part1" id="rfc.xref.Part1.5"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>) apply only during message transfer and do not require distinct entity-tags. 925 </p> 926 </div> 919 927 <h1 id="rfc.section.3"><a href="#rfc.section.3">3.</a> <a id="header.fields" href="#header.fields">Precondition Header Fields</a></h1> 920 928 <p id="rfc.section.3.p.1">This section defines the syntax and semantics of HTTP/1.1 header fields for applying preconditions on requests.</p> … … 927 935 An If-Match field-value of "*" places the precondition on the existence of any current representation for the target resource. 928 936 </p> 929 <div id="rfc.figure.u. 10"></div><pre class="inline"><span id="rfc.iref.g.6"></span> <a href="#header.if-match" class="smpl">If-Match</a> = "*" / 1#<a href="#entity.tags" class="smpl">entity-tag</a>937 <div id="rfc.figure.u.9"></div><pre class="inline"><span id="rfc.iref.g.6"></span> <a href="#header.if-match" class="smpl">If-Match</a> = "*" / 1#<a href="#header.etag" class="smpl">entity-tag</a> 930 938 </pre><p id="rfc.section.3.1.p.3">If any of the entity-tags listed in the If-Match field value match the entity-tag of the selected representation for the target 931 939 resource, or if "*" is given and any current representation exists for the target resource, then the server <em class="bcp14">MAY</em> perform the request method as if the If-Match header field was not present. … … 937 945 </p> 938 946 <p id="rfc.section.3.1.p.6">Examples:</p> 939 <div id="rfc.figure.u.1 1"></div><pre class="text"> If-Match: "xyzzy"947 <div id="rfc.figure.u.10"></div><pre class="text"> If-Match: "xyzzy" 940 948 If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz" 941 949 If-Match: * … … 957 965 for the target resource. 958 966 </p> 959 <div id="rfc.figure.u.1 2"></div><pre class="inline"><span id="rfc.iref.g.7"></span> <a href="#header.if-none-match" class="smpl">If-None-Match</a> = "*" / 1#<a href="#entity.tags" class="smpl">entity-tag</a>967 <div id="rfc.figure.u.11"></div><pre class="inline"><span id="rfc.iref.g.7"></span> <a href="#header.if-none-match" class="smpl">If-None-Match</a> = "*" / 1#<a href="#header.etag" class="smpl">entity-tag</a> 960 968 </pre><p id="rfc.section.3.2.p.4">If any of the entity-tags listed in the If-None-Match field-value match the entity-tag of the selected representation, or 961 969 if "*" is given and any current representation exists for that resource, then the server <em class="bcp14">MUST NOT</em> perform the requested method. Instead, if the request method was GET or HEAD, the server <em class="bcp14">SHOULD</em> respond with a 304 (Not Modified) status code, including the cache-related header fields (particularly ETag) of the selected … … 965 973 </p> 966 974 <p id="rfc.section.3.2.p.6">If the request would, without the If-None-Match header field, result in anything other than a 2xx or 304 status code, then 967 the If-None-Match header field <em class="bcp14">MUST</em> be ignored. (See <a href="#rules.for.when.to.use.entity.tags.and.last-modified.dates" title="Rules for When to Use Entity-tags and Last-Modified Dates">Section 2. 4</a> for a discussion of server behavior when both If-Modified-Since and If-None-Match appear in the same request.)975 the If-None-Match header field <em class="bcp14">MUST</em> be ignored. (See <a href="#rules.for.when.to.use.entity.tags.and.last-modified.dates" title="Rules for When to Use Entity-tags and Last-Modified Dates">Section 2.2.4</a> for a discussion of server behavior when both If-Modified-Since and If-None-Match appear in the same request.) 968 976 </p> 969 977 <p id="rfc.section.3.2.p.7">Examples:</p> 970 <div id="rfc.figure.u.1 3"></div><pre class="text"> If-None-Match: "xyzzy"978 <div id="rfc.figure.u.12"></div><pre class="text"> If-None-Match: "xyzzy" 971 979 If-None-Match: W/"xyzzy" 972 980 If-None-Match: "xyzzy", "r2d2xxxx", "c3piozzzz" … … 982 990 the time specified in this field, then do not perform the request method; instead, respond as detailed below. 983 991 </p> 984 <div id="rfc.figure.u.1 4"></div><pre class="inline"><span id="rfc.iref.g.8"></span> <a href="#header.if-modified-since" class="smpl">If-Modified-Since</a> = <a href="#notation" class="smpl">HTTP-date</a>992 <div id="rfc.figure.u.13"></div><pre class="inline"><span id="rfc.iref.g.8"></span> <a href="#header.if-modified-since" class="smpl">If-Modified-Since</a> = <a href="#notation" class="smpl">HTTP-date</a> 985 993 </pre><p id="rfc.section.3.3.p.3">An example of the field is:</p> 986 <div id="rfc.figure.u.1 5"></div><pre class="text"> If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT994 <div id="rfc.figure.u.14"></div><pre class="text"> If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT 987 995 </pre><p id="rfc.section.3.3.p.5">A GET method with an If-Modified-Since header field and no Range header field requests that the selected representation be 988 996 transferred only if it has been modified since the date given by the If-Modified-Since header field. The algorithm for determining … … 1002 1010 <p id="rfc.section.3.3.p.6">The purpose of this feature is to allow efficient updates of cached information with a minimum amount of transaction overhead. </p> 1003 1011 <ul class="empty"> 1004 <li> <b>Note:</b> The Range header field modifies the meaning of If-Modified-Since; see <a href="p5-range.html#header.range" title="Range">Section 5.4</a> of <a href="#Part5" id="rfc.xref.Part5. 4"><cite title="HTTP/1.1, part 5: Range Requests and Partial Responses">[Part5]</cite></a> for full details.1012 <li> <b>Note:</b> The Range header field modifies the meaning of If-Modified-Since; see <a href="p5-range.html#header.range" title="Range">Section 5.4</a> of <a href="#Part5" id="rfc.xref.Part5.1"><cite title="HTTP/1.1, part 5: Range Requests and Partial Responses">[Part5]</cite></a> for full details. 1005 1013 </li> 1006 1014 <li> <b>Note:</b> If-Modified-Since times are interpreted by the server, whose clock might not be synchronized with the client. … … 1030 1038 the time specified in this field, the server <em class="bcp14">SHOULD</em> perform the request method as if the If-Unmodified-Since header field were not present. 1031 1039 </p> 1032 <div id="rfc.figure.u.1 6"></div><pre class="inline"><span id="rfc.iref.g.9"></span> <a href="#header.if-unmodified-since" class="smpl">If-Unmodified-Since</a> = <a href="#notation" class="smpl">HTTP-date</a>1040 <div id="rfc.figure.u.15"></div><pre class="inline"><span id="rfc.iref.g.9"></span> <a href="#header.if-unmodified-since" class="smpl">If-Unmodified-Since</a> = <a href="#notation" class="smpl">HTTP-date</a> 1033 1041 </pre><p id="rfc.section.3.4.p.3">An example of the field is:</p> 1034 <div id="rfc.figure.u.1 7"></div><pre class="text"> If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT1042 <div id="rfc.figure.u.16"></div><pre class="text"> If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT 1035 1043 </pre><p id="rfc.section.3.4.p.5">If the request normally (i.e., without the If-Unmodified-Since header field) would result in anything other than a 2xx or 1036 1044 412 status code, the If-Unmodified-Since header field <em class="bcp14">SHOULD</em> be ignored. … … 1040 1048 <p id="rfc.section.3.4.p.7">The result of a request having both an If-Unmodified-Since header field and either an If-None-Match or an If-Modified-Since 1041 1049 header fields is undefined by this specification. 1050 </p> 1051 <h2 id="rfc.section.3.5"><a href="#rfc.section.3.5">3.5</a> <a id="header.if-range" href="#header.if-range">If-Range</a></h2> 1052 <p id="rfc.section.3.5.p.1">The If-Range header field provides a special conditional request mechanism that is similar to If-Match and If-Unmodified-Since 1053 but specific to HTTP range requests. If-Range is defined in <a href="p5-range.html#header.if-range" title="If-Range">Section 5.3</a> of <a href="#Part5" id="rfc.xref.Part5.2"><cite title="HTTP/1.1, part 5: Range Requests and Partial Responses">[Part5]</cite></a>. 1042 1054 </p> 1043 1055 <h1 id="rfc.section.4"><a href="#rfc.section.4">4.</a> <a id="status.code.definitions" href="#status.code.definitions">Status Code Definitions</a></h1> … … 1120 1132 <td class="left">http</td> 1121 1133 <td class="left">standard</td> 1122 <td class="left"> <a href="#header.etag" id="rfc.xref.header.etag. 2" title="ETag">Section 2.2.1</a>1134 <td class="left"> <a href="#header.etag" id="rfc.xref.header.etag.1" title="ETag">Section 2.2</a> 1123 1135 </td> 1124 1136 </tr> … … 1127 1139 <td class="left">http</td> 1128 1140 <td class="left">standard</td> 1129 <td class="left"> <a href="#header.if-match" id="rfc.xref.header.if-match. 2" title="If-Match">Section 3.1</a>1141 <td class="left"> <a href="#header.if-match" id="rfc.xref.header.if-match.1" title="If-Match">Section 3.1</a> 1130 1142 </td> 1131 1143 </tr> … … 1141 1153 <td class="left">http</td> 1142 1154 <td class="left">standard</td> 1143 <td class="left"> <a href="#header.if-none-match" id="rfc.xref.header.if-none-match. 2" title="If-None-Match">Section 3.2</a>1155 <td class="left"> <a href="#header.if-none-match" id="rfc.xref.header.if-none-match.1" title="If-None-Match">Section 3.2</a> 1144 1156 </td> 1145 1157 </tr> … … 1240 1252 </div> 1241 1253 <h1 id="rfc.section.A" class="np"><a href="#rfc.section.A">A.</a> <a id="changes.from.rfc.2616" href="#changes.from.rfc.2616">Changes from RFC 2616</a></h1> 1242 <p id="rfc.section.A.p.1">Allow weak entity-tags in all requests except range requests (Sections <a href="#weak.and.strong.validators" title="Weak and Strong Validators">2.3</a> and <a href="#header.if-none-match" id="rfc.xref.header.if-none-match.3" title="If-None-Match">3.2</a>).1254 <p id="rfc.section.A.p.1">Allow weak entity-tags in all requests except range requests (Sections <a href="#weak.and.strong.validators" title="Weak versus Strong">2.2.2</a> and <a href="#header.if-none-match" id="rfc.xref.header.if-none-match.2" title="If-None-Match">3.2</a>). 1243 1255 </p> 1244 1256 <p id="rfc.section.A.p.2">Change ABNF productions for header fields to only define the field value. (<a href="#header.fields" title="Precondition Header Fields">Section 3</a>) 1245 1257 </p> 1246 1258 <h1 id="rfc.section.B"><a href="#rfc.section.B">B.</a> <a id="collected.abnf" href="#collected.abnf">Collected ABNF</a></h1> 1247 <div id="rfc.figure.u.1 8"></div> <pre class="inline"><a href="#header.etag" class="smpl">ETag</a> = entity-tag1259 <div id="rfc.figure.u.17"></div> <pre class="inline"><a href="#header.etag" class="smpl">ETag</a> = entity-tag 1248 1260 1249 1261 <a href="#notation" class="smpl">HTTP-date</a> = <HTTP-date, defined in [Part1], Section 6.1> … … 1260 1272 <a href="#notation" class="smpl">OWS</a> = <OWS, defined in [Part1], Section 1.2.2> 1261 1273 1262 <a href="# entity.tags" class="smpl">entity-tag</a> = [ weak ] opaque-tag1263 1264 <a href="# entity.tags" class="smpl">opaque-tag</a> = quoted-string1274 <a href="#header.etag" class="smpl">entity-tag</a> = [ weak ] opaque-tag 1275 1276 <a href="#header.etag" class="smpl">opaque-tag</a> = quoted-string 1265 1277 1266 1278 <a href="#notation" class="smpl">quoted-string</a> = <quoted-string, defined in [Part1], Section 1.2.2> 1267 1279 1268 <a href="# entity.tags" class="smpl">weak</a> = %x57.2F ; W/1269 </pre> <div id="rfc.figure.u.1 9"></div>1280 <a href="#header.etag" class="smpl">weak</a> = %x57.2F ; W/ 1281 </pre> <div id="rfc.figure.u.18"></div> 1270 1282 <p>ABNF diagnostics:</p><pre class="inline">; ETag defined but not used 1271 1283 ; If-Match defined but not used … … 1392 1404 </li> 1393 1405 <li><a id="rfc.index.E" href="#rfc.index.E"><b>E</b></a><ul> 1394 <li>ETag header field <a href="#rfc. xref.header.etag.1">2.2</a>, <a href="#rfc.iref.e.1"><b>2.2.1</b></a>, <a href="#rfc.xref.header.etag.2">5.2</a></li>1406 <li>ETag header field <a href="#rfc.iref.e.1"><b>2.2</b></a>, <a href="#rfc.xref.header.etag.1">5.2</a></li> 1395 1407 </ul> 1396 1408 </li> … … 1398 1410 <li><tt>Grammar</tt> 1399 1411 <ul> 1400 <li><tt>entity-tag</tt> <a href="#rfc.iref.g. 2"><b>2.2</b></a></li>1401 <li><tt>ETag</tt> <a href="#rfc.iref.g. 5"><b>2.2.1</b></a></li>1412 <li><tt>entity-tag</tt> <a href="#rfc.iref.g.3"><b>2.2</b></a></li> 1413 <li><tt>ETag</tt> <a href="#rfc.iref.g.2"><b>2.2</b></a></li> 1402 1414 <li><tt>If-Match</tt> <a href="#rfc.iref.g.6"><b>3.1</b></a></li> 1403 1415 <li><tt>If-Modified-Since</tt> <a href="#rfc.iref.g.8"><b>3.3</b></a></li> … … 1405 1417 <li><tt>If-Unmodified-Since</tt> <a href="#rfc.iref.g.9"><b>3.4</b></a></li> 1406 1418 <li><tt>Last-Modified</tt> <a href="#rfc.iref.g.1"><b>2.1</b></a></li> 1407 <li><tt>opaque-tag</tt> <a href="#rfc.iref.g. 4"><b>2.2</b></a></li>1408 <li><tt>weak</tt> <a href="#rfc.iref.g. 3"><b>2.2</b></a></li>1419 <li><tt>opaque-tag</tt> <a href="#rfc.iref.g.5"><b>2.2</b></a></li> 1420 <li><tt>weak</tt> <a href="#rfc.iref.g.4"><b>2.2</b></a></li> 1409 1421 </ul> 1410 1422 </li> … … 1414 1426 <li>Header Fields 1415 1427 <ul> 1416 <li>ETag <a href="#rfc. xref.header.etag.1">2.2</a>, <a href="#rfc.iref.h.2"><b>2.2.1</b></a>, <a href="#rfc.xref.header.etag.2">5.2</a></li>1417 <li>If-Match <a href="#rfc. xref.header.if-match.1">2.2</a>, <a href="#rfc.iref.h.3"><b>3.1</b></a>, <a href="#rfc.xref.header.if-match.2">5.2</a></li>1428 <li>ETag <a href="#rfc.iref.h.2"><b>2.2</b></a>, <a href="#rfc.xref.header.etag.1">5.2</a></li> 1429 <li>If-Match <a href="#rfc.iref.h.3"><b>3.1</b></a>, <a href="#rfc.xref.header.if-match.1">5.2</a></li> 1418 1430 <li>If-Modified-Since <a href="#rfc.iref.h.5"><b>3.3</b></a>, <a href="#rfc.xref.header.if-modified-since.1">5.2</a></li> 1419 <li>If-None-Match <a href="#rfc. xref.header.if-none-match.1">2.2</a>, <a href="#rfc.iref.h.4"><b>3.2</b></a>, <a href="#rfc.xref.header.if-none-match.2">5.2</a>, <a href="#rfc.xref.header.if-none-match.3">A</a></li>1431 <li>If-None-Match <a href="#rfc.iref.h.4"><b>3.2</b></a>, <a href="#rfc.xref.header.if-none-match.1">5.2</a>, <a href="#rfc.xref.header.if-none-match.2">A</a></li> 1420 1432 <li>If-Unmodified-Since <a href="#rfc.iref.h.6"><b>3.4</b></a>, <a href="#rfc.xref.header.if-unmodified-since.1">5.2</a></li> 1421 1433 <li>Last-Modified <a href="#rfc.iref.h.1"><b>2.1</b></a>, <a href="#rfc.xref.header.last-modified.1">5.2</a></li> … … 1425 1437 </li> 1426 1438 <li><a id="rfc.index.I" href="#rfc.index.I"><b>I</b></a><ul> 1427 <li>If-Match header field <a href="#rfc. xref.header.if-match.1">2.2</a>, <a href="#rfc.iref.i.1"><b>3.1</b></a>, <a href="#rfc.xref.header.if-match.2">5.2</a></li>1439 <li>If-Match header field <a href="#rfc.iref.i.1"><b>3.1</b></a>, <a href="#rfc.xref.header.if-match.1">5.2</a></li> 1428 1440 <li>If-Modified-Since header field <a href="#rfc.iref.i.3"><b>3.3</b></a>, <a href="#rfc.xref.header.if-modified-since.1">5.2</a></li> 1429 <li>If-None-Match header field <a href="#rfc. xref.header.if-none-match.1">2.2</a>, <a href="#rfc.iref.i.2"><b>3.2</b></a>, <a href="#rfc.xref.header.if-none-match.2">5.2</a>, <a href="#rfc.xref.header.if-none-match.3">A</a></li>1441 <li>If-None-Match header field <a href="#rfc.iref.i.2"><b>3.2</b></a>, <a href="#rfc.xref.header.if-none-match.1">5.2</a>, <a href="#rfc.xref.header.if-none-match.2">A</a></li> 1430 1442 <li>If-Unmodified-Since header field <a href="#rfc.iref.i.4"><b>3.4</b></a>, <a href="#rfc.xref.header.if-unmodified-since.1">5.2</a></li> 1431 1443 </ul> … … 1440 1452 </li> 1441 1453 <li><a id="rfc.index.P" href="#rfc.index.P"><b>P</b></a><ul> 1442 <li><em>Part1</em> <a href="#rfc.xref.Part1.1">1.2</a>, <a href="#rfc.xref.Part1.2">1.2</a>, <a href="#rfc.xref.Part1.3">1.2</a>, <a href="#rfc.xref.Part1.4">1.2</a>, <a href="#rfc.xref.Part1.5">2.2. 2</a>, <a href="#rfc.xref.Part1.6">4.1</a>, <a href="#rfc.xref.Part1.7">4.1</a>, <a href="#rfc.xref.Part1.8">6</a>, <a href="#Part1"><b>8.1</b></a><ul>1454 <li><em>Part1</em> <a href="#rfc.xref.Part1.1">1.2</a>, <a href="#rfc.xref.Part1.2">1.2</a>, <a href="#rfc.xref.Part1.3">1.2</a>, <a href="#rfc.xref.Part1.4">1.2</a>, <a href="#rfc.xref.Part1.5">2.2.5</a>, <a href="#rfc.xref.Part1.6">4.1</a>, <a href="#rfc.xref.Part1.7">4.1</a>, <a href="#rfc.xref.Part1.8">6</a>, <a href="#Part1"><b>8.1</b></a><ul> 1443 1455 <li><em>Section 1.2</em> <a href="#rfc.xref.Part1.1">1.2</a></li> 1444 1456 <li><em>Section 1.2.2</em> <a href="#rfc.xref.Part1.2">1.2</a>, <a href="#rfc.xref.Part1.3">1.2</a></li> 1445 1457 <li><em>Section 6.1</em> <a href="#rfc.xref.Part1.4">1.2</a></li> 1446 <li><em>Section 6.2</em> <a href="#rfc.xref.Part1.5">2.2. 2</a></li>1458 <li><em>Section 6.2</em> <a href="#rfc.xref.Part1.5">2.2.5</a></li> 1447 1459 <li><em>Section 9.3</em> <a href="#rfc.xref.Part1.6">4.1</a></li> 1448 1460 <li><em>Section 9.3.1</em> <a href="#rfc.xref.Part1.7">4.1</a></li> 1449 1461 </ul> 1450 1462 </li> 1451 <li><em>Part3</em> <a href="#rfc.xref.Part3.1">2.2. 2</a>, <a href="#rfc.xref.Part3.2">2.2.2</a>, <a href="#Part3"><b>8.1</b></a><ul>1452 <li><em>Section 5</em> <a href="#rfc.xref.Part3.1">2.2. 2</a></li>1453 <li><em>Section 6.3</em> <a href="#rfc.xref.Part3.2">2.2. 2</a></li>1463 <li><em>Part3</em> <a href="#rfc.xref.Part3.1">2.2.5</a>, <a href="#rfc.xref.Part3.2">2.2.5</a>, <a href="#Part3"><b>8.1</b></a><ul> 1464 <li><em>Section 5</em> <a href="#rfc.xref.Part3.1">2.2.5</a></li> 1465 <li><em>Section 6.3</em> <a href="#rfc.xref.Part3.2">2.2.5</a></li> 1454 1466 </ul> 1455 1467 </li> 1456 <li><em>Part5</em> <a href="#rfc.xref.Part5.1"> 2.2</a>, <a href="#rfc.xref.Part5.2">2.3</a>, <a href="#rfc.xref.Part5.3">2.3</a>, <a href="#rfc.xref.Part5.4">3.3</a>, <a href="#Part5"><b>8.1</b></a><ul>1457 <li><em>Section 5.3</em> <a href="#rfc.xref.Part5. 1">2.2</a></li>1458 <li><em>Section 5.4</em> <a href="#rfc.xref.Part5. 4">3.3</a></li>1468 <li><em>Part5</em> <a href="#rfc.xref.Part5.1">3.3</a>, <a href="#rfc.xref.Part5.2">3.5</a>, <a href="#Part5"><b>8.1</b></a><ul> 1469 <li><em>Section 5.3</em> <a href="#rfc.xref.Part5.2">3.5</a></li> 1470 <li><em>Section 5.4</em> <a href="#rfc.xref.Part5.1">3.3</a></li> 1459 1471 </ul> 1460 1472 </li> 1461 <li><em>Part6</em> <a href="#rfc.xref.Part6.1">1</a>, <a href="# Part6"><b>8.1</b></a></li>1473 <li><em>Part6</em> <a href="#rfc.xref.Part6.1">1</a>, <a href="#rfc.xref.Part6.2">2.1.1</a>, <a href="#rfc.xref.Part6.3">2.2.1</a>, <a href="#Part6"><b>8.1</b></a></li> 1462 1474 </ul> 1463 1475 </li> -
draft-ietf-httpbis/latest/p4-conditional.xml
r1254 r1260 221 221 specify preconditions to be checked before performing the action 222 222 given by the request method. Conditional GET requests are the most 223 efficient mechanism for HTTP cache updates &caching;. Conditionals can be 223 efficient mechanism for HTTP cache updates &caching;. Conditionals 224 can also be 224 225 applied to state-changing methods, such as PUT and DELETE, to prevent 225 226 the "lost update" problem: one client accidentally overwriting … … 313 314 has been defined by various extensions of HTTP, such as WebDAV 314 315 <xref target="RFC4918"/>, that are beyond the scope of this specification. 315 Such metadata is referred to as a "<x:dfn>validator</x:dfn>" when it is316 used within a precondition.316 A resource metadata value is referred to as a "<x:dfn>validator</x:dfn>" 317 when it is used within a precondition. 317 318 </t> 318 319 … … 323 324 <t> 324 325 The "Last-Modified" header field indicates the date and time at 325 which the origin server believes the representation was last modified. 326 which the origin server believes the selected representation was 327 last modified. 326 328 </t> 327 329 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Last-Modified"/> … … 334 336 Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT 335 337 </artwork></figure> 338 339 <section title="Generation" anchor="lastmod.generation"> 340 <t> 341 Origin servers &SHOULD; send Last-Modified for any selected 342 representation for which a last modification date can be reasonably 343 and consistently determined, since its use in conditional requests 344 and evaluating cache freshness (&caching;) results in a substantial 345 reduction of HTTP traffic on the Internet and can be a significant 346 factor in improving service scalability and reliability. 347 </t> 336 348 <t> 337 349 A representation is typically the sum of many parts behind the … … 345 357 </t> 346 358 <t> 347 An origin server &MUST-NOT; send a Last-Modified date which is later 348 than the server's time of message origination. In such cases, where 349 the resource's last modification would indicate some time in the 350 future, the server &MUST; replace that date with the message 351 origination date. 352 </t> 353 <t> 354 An origin server &SHOULD; obtain the Last-Modified value of the representation 355 as close as possible to the time that it generates the Date value of 356 its response. This allows a recipient to make an accurate assessment 357 of the representation's modification time, especially if the representation changes 358 near the time that the response is generated. 359 </t> 360 <t> 361 HTTP/1.1 servers &SHOULD; send Last-Modified whenever feasible. 362 </t> 363 <t> 364 The Last-Modified header field value is often used as a cache 365 validator. In simple terms, a cache entry is considered to be valid 366 if the representation has not been modified since the Last-Modified value. 367 </t> 368 </section> 369 370 <section title="Entity Tags" anchor="entity.tags"> 359 An origin server &SHOULD; obtain the Last-Modified value of the 360 representation as close as possible to the time that it generates 361 the Date field-value for its response. This allows a recipient to 362 make an accurate assessment of the representation's modification time, 363 especially if the representation changes near the time that the 364 response is generated. 365 </t> 366 <t> 367 An origin server with a clock &MUST-NOT; send a Last-Modified date 368 that is later than the server's time of message origination (Date). 369 If the last modification time is derived from implementation-specific 370 metadata that evaluates to some time in the future, according to the 371 origin server's clock, then the origin server &MUST; replace that 372 value with the message origination date. This prevents a future 373 modification date from having an adverse impact on cache validation. 374 </t> 375 </section> 376 377 <section title="Comparison" anchor="lastmod.comparison"> 378 <t> 379 A Last-Modified time, when used as a validator in a request, is 380 implicitly weak unless it is possible to deduce that it is strong, 381 using the following rules: 382 <list style="symbols"> 383 <t>The validator is being compared by an origin server to the 384 actual current validator for the representation and,</t> 385 <t>That origin server reliably knows that the associated representation did 386 not change twice during the second covered by the presented 387 validator.</t> 388 </list> 389 </t> 390 <t> 391 or 392 <list style="symbols"> 393 <t>The validator is about to be used by a client in an If-Modified-Since 394 or If-Unmodified-Since header field, because the client 395 has a cache entry for the associated representation, and</t> 396 <t>That cache entry includes a Date value, which gives the time 397 when the origin server sent the original response, and</t> 398 <t>The presented Last-Modified time is at least 60 seconds before 399 the Date value.</t> 400 </list> 401 </t> 402 <t> 403 or 404 <list style="symbols"> 405 <t>The validator is being compared by an intermediate cache to the 406 validator stored in its cache entry for the representation, and</t> 407 <t>That cache entry includes a Date value, which gives the time 408 when the origin server sent the original response, and</t> 409 <t>The presented Last-Modified time is at least 60 seconds before 410 the Date value.</t> 411 </list> 412 </t> 413 <t> 414 This method relies on the fact that if two different responses were 415 sent by the origin server during the same second, but both had the 416 same Last-Modified time, then at least one of those responses would 417 have a Date value equal to its Last-Modified time. The arbitrary 60-second 418 limit guards against the possibility that the Date and Last-Modified 419 values are generated from different clocks, or at somewhat 420 different times during the preparation of the response. An 421 implementation &MAY; use a value larger than 60 seconds, if it is 422 believed that 60 seconds is too short. 423 </t> 424 </section> 425 </section> 426 427 <section title="ETag" anchor="header.etag"> 428 <iref primary="true" item="ETag header field" x:for-anchor=""/> 429 <iref primary="true" item="Header Fields" subitem="ETag" x:for-anchor=""/> 430 <x:anchor-alias value="ETag"/> 371 431 <x:anchor-alias value="entity-tag"/> 432 <x:anchor-alias value="entity.tags"/> 372 433 <x:anchor-alias value="opaque-tag"/> 373 434 <x:anchor-alias value="weak"/> 374 435 <t> 375 Entity-tags are used for comparing two or more representations of the same 376 resource. HTTP/1.1 uses entity-tags in the ETag (<xref target="header.etag"/>), 377 If-Match (<xref target="header.if-match"/>), If-None-Match (<xref target="header.if-none-match"/>), and 378 If-Range (&header-if-range;) header fields. The definition of how they 379 are used and compared as cache validators is in <xref target="weak.and.strong.validators"/>. An 380 entity-tag consists of an opaque quoted string, possibly prefixed by 381 a weakness indicator. 382 </t> 383 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="entity-tag"/><iref primary="true" item="Grammar" subitem="weak"/><iref primary="true" item="Grammar" subitem="opaque-tag"/> 436 The ETag header field provides the current entity-tag for the 437 selected representation. 438 An entity-tag is an opaque validator for differentiating between 439 multiple representations of the same resource, regardless of whether 440 those multiple representations are due to resource state changes over 441 time, content negotiation resulting in multiple representations being 442 valid at the same time, or both. An entity-tag consists of an opaque 443 quoted string, possibly prefixed by a weakness indicator. 444 </t> 445 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="ETag"/><iref primary="true" item="Grammar" subitem="entity-tag"/><iref primary="true" item="Grammar" subitem="weak"/><iref primary="true" item="Grammar" subitem="opaque-tag"/> 446 <x:ref>ETag</x:ref> = <x:ref>entity-tag</x:ref> 447 384 448 <x:ref>entity-tag</x:ref> = [ <x:ref>weak</x:ref> ] <x:ref>opaque-tag</x:ref> 385 449 <x:ref>weak</x:ref> = <x:abnf-char-sequence>"W/"</x:abnf-char-sequence> ; "W/", case-sensitive … … 387 451 </artwork></figure> 388 452 <t> 389 A "strong entity-tag" &MAY; be shared by two representations of a resource 390 only if they are equivalent by octet equality. 391 </t> 392 <t> 393 A "weak entity-tag", indicated by the "W/" prefix, &MAY; be shared by 394 two representations of a resource. A weak entity-tag can only be used 395 for weak comparison. 396 </t> 397 <t> 398 Cache entries might persist for arbitrarily long periods, regardless 399 of expiration times, so it is inappropriate to expect that a cache will 400 never again attempt to validate an entry using a validator that it 401 obtained at some point in the past. 402 A strong entity-tag &MUST; be unique across all versions of all 403 representations associated with a particular resource over time. 404 However, there is no implication of uniqueness across entity-tags 405 of different resources (i.e., the same entity-tag value might be 406 in use for representations of multiple resources at the same time 407 and does not imply that those representations are equivalent). 408 </t> 409 410 <section title="ETag" anchor="header.etag"> 411 <iref primary="true" item="ETag header field" x:for-anchor=""/> 412 <iref primary="true" item="Header Fields" subitem="ETag" x:for-anchor=""/> 413 <x:anchor-alias value="ETag"/> 414 <t> 415 The "ETag" header field provides the current value of the 416 entity-tag (see <xref target="entity.tags"/>) for one representation of 417 the target resource. An entity-tag 418 is intended for use as a resource-local identifier for differentiating 419 between representations of the same resource that vary over time or via 420 content negotiation (see <xref target="weak.and.strong.validators"/>). 421 </t> 422 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="ETag"/> 423 <x:ref>ETag</x:ref> = <x:ref>entity-tag</x:ref> 424 </artwork></figure> 453 An entity-tag can be more reliable for validation than a modification 454 date in situations where it is inconvenient to store modification 455 dates, where the one-second resolution of HTTP date values is not 456 sufficient, or where modification dates are not consistently maintained. 457 </t> 425 458 <figure><preamble> 426 459 Examples: … … 431 464 ETag: "" 432 465 </artwork></figure> 433 <t> 434 An entity-tag provides an "opaque" cache validator that allows for 435 more reliable validation than modification dates in situations where 436 it is inconvenient to store modification dates, 437 where the one-second resolution of HTTP date values is not 438 sufficient, or where the origin server wishes to avoid certain 439 paradoxes that might arise from the use of modification dates. 440 </t> 466 467 <section title="Generation" anchor="entity.tag.generation"> 441 468 <t> 442 469 The principle behind entity-tags is that only the service author 443 knows the semantics of a resource well enough to select an 444 appropriate cache validation mechanism, and the specification of any 445 validator comparison function more complex than byte-equality would 446 open up a can of worms. Thus, comparisons of any other header fields 447 (except Last-Modified, for compatibility with HTTP/1.0) are never 448 used for purposes of validating a cache entry. 449 </t> 450 </section> 451 452 <section title="Example: Entity-tags varying on Content-Negotiated Resources" anchor="example.entity.tag.vs.conneg"> 453 <t> 454 Consider a resource that is subject to content negotiation (&content-negotiation;), 455 and where the representations returned upon a GET request vary based on 456 the Accept-Encoding request header field (&header-accept-encoding;): 457 </t> 458 <figure><preamble>>> Request:</preamble><artwork type="message/http; msgtype="request"" x:indent-with=" "> 459 GET /index HTTP/1.1 460 Host: www.example.com 461 Accept-Encoding: gzip 462 463 </artwork></figure> 464 <t> 465 In this case, the response might or might not use the gzip content coding. 466 If it does not, the response might look like: 467 </t> 468 <figure><preamble>>> Response:</preamble><artwork type="message/http; msgtype="response"" x:indent-with=" "> 469 HTTP/1.1 200 OK 470 Date: Thu, 26 Mar 2010 00:05:00 GMT 471 ETag: "123-a" 472 Content-Length: <x:length-of target="exbody"/> 473 Vary: Accept-Encoding 474 Content-Type: text/plain 475 476 <x:span anchor="exbody">Hello World! 477 Hello World! 478 Hello World! 479 Hello World! 480 Hello World! 481 </x:span></artwork></figure> 482 <t> 483 An alternative representation that does use gzip content coding would be: 484 </t> 485 <figure><preamble>>> Response:</preamble><artwork type="message/http; msgtype="response"" x:indent-with=" "> 486 HTTP/1.1 200 OK 487 Date: Thu, 26 Mar 2010 00:05:00 GMT 488 ETag: "123-b" 489 Content-Length: 43 490 Vary: Accept-Encoding 491 Content-Type: text/plain 492 Content-Encoding: gzip 493 494 <spanx>...binary data...</spanx></artwork></figure> 495 <x:note> 496 <t> 497 <x:h>Note:</x:h> Content codings are a property of the representation, 498 so therefore an entity-tag of an encoded representation must be distinct 499 from an unencoded representation to prevent conflicts during cache updates 500 and range requests. In contrast, transfer codings (&transfer-codings;) 501 apply only during message transfer and do not require distinct entity-tags. 502 </t> 503 </x:note> 504 </section> 505 </section> 506 507 <section title="Weak and Strong Validators" anchor="weak.and.strong.validators"> 470 knows the implementation of a resource well enough to select the 471 most accurate and efficient validation mechanism for that resource, 472 and that any such mechanism can be mapped to a simple sequence of 473 octets for easy comparison. Since the value is opaque, there is no 474 need for the client to be aware of how each entity-tag is constructed. 475 </t> 476 <t> 477 For example, a resource that has implementation-specific versioning 478 applied to all changes might use an internal revision number, perhaps 479 combined with a variance identifier for content negotiation, to 480 accurately differentiate between representations. 481 Other implementations might use a stored hash of representation content, 482 a combination of various filesystem attributes, or a modification 483 timestamp that has sub-second resolution. 484 </t> 485 <t> 486 Origin servers &SHOULD; send ETag for any selected representation 487 for which detection of changes can be reasonably and consistently 488 determined, since the entity-tag's use in conditional requests and 489 evaluating cache freshness (&caching;) can result in a substantial 490 reduction of HTTP network traffic and can be a significant factor in 491 improving service scalability and reliability. 492 </t> 493 </section> 494 495 <section title="Weak versus Strong" anchor="weak.and.strong.validators"> 508 496 <t> 509 497 Since both origin servers and caches will compare two validators to 510 decide if they representthe same or different representations, one498 decide if they indicate the same or different representations, one 511 499 normally would expect that if the representation (including both 512 500 representation header fields and representation body) changes in any 513 501 way, then the associated validator would change as well. If this is 514 true, then we call th isvalidator a "strong validator". One example502 true, then we call that validator a "strong validator". One example 515 503 of a strong validator is an integer that is incremented in stable 516 504 storage every time a representation is changed. … … 529 517 </t> 530 518 <t> 519 One can think of a strong validator as part of an identifier for a 520 specific representation, whereas a weak validator is part of an 521 identifier for a set of equivalent representations (where this notion 522 of equivalence is entirely governed by the origin server and beyond 523 the scope of this specification). 524 </t> 525 <t> 531 526 An entity-tag is normally a strong validator, but the protocol 532 provides a mechanism to tag an entity-tag as "weak". One can think 533 of a strong validator as part of an identifier for a specific 534 representation, whereas a weak validator is part of an identifier 535 for a set of equivalent representations (where this notion of 536 equivalence is entirely governed by the origin server and beyond 537 the scope of this specification). 527 provides a mechanism to tag an entity-tag as "weak". 538 528 <list><t> 539 529 A representation's modification time, if defined with only one-second … … 556 546 </t> 557 547 <t> 558 A "use" of a validator is either when a client generates a request 559 and includes the validator in a validating header field, or when a 560 server compares two validators. 561 </t> 562 <t> 563 Strong validators are usable in any context. Weak validators are only 564 usable in contexts that do not depend on exact equality of a representation. 565 For example, either kind is usable for a normal conditional GET. 566 However, only a strong validator is usable for range retrieval 567 (<xref target="Part5"/>), since otherwise the client might end up 568 with an internally inconsistent representation. 569 Clients &MUST-NOT; use weak validators in range requests. 570 </t> 571 <t> 572 The only function that HTTP/1.1 defines on validators is 573 comparison. There are two validator comparison functions, depending 548 A "strong entity-tag" &MAY; be shared by two representations of a resource 549 only if they are equivalent by octet equality. 550 </t> 551 <t> 552 A "weak entity-tag", indicated by the "W/" prefix, &MAY; be shared by 553 two representations of a resource. A weak entity-tag can only be used 554 for weak comparison. 555 </t> 556 <t> 557 Cache entries might persist for arbitrarily long periods, regardless 558 of expiration times. Thus, a cache might attempt to validate an 559 entry using a validator that it obtained in the distant past. 560 A strong entity-tag &MUST; be unique across all versions of all 561 representations associated with a particular resource over time. 562 However, there is no implication of uniqueness across entity-tags 563 of different resources (i.e., the same entity-tag value might be 564 in use for representations of multiple resources at the same time 565 and does not imply that those representations are equivalent). 566 </t> 567 </section> 568 569 <section title="Comparison" anchor="entity.tag.comparison"> 570 <x:anchor-alias value="validator.comparison"/> 571 <t> 572 There are two entity-tag comparison functions, depending 574 573 on whether the comparison context allows the use of weak validators 575 574 or not: … … 585 584 </t> 586 585 <t> 586 A "use" of a validator is either when a client generates a request 587 and includes the validator in a precondition, or when a server 588 compares two validators. 589 </t> 590 <t> 591 Strong validators are usable in any context. Weak validators are only 592 usable in contexts that do not depend on exact equality of a representation. 593 For example, either kind is usable for a normal conditional GET. 594 </t> 595 <t> 587 596 The example below shows the results for a set of entity-tag pairs, 588 597 and both the weak and strong comparison function results: … … 616 625 <t> 617 626 An entity-tag is strong unless it is explicitly tagged as weak. 618 <xref target="entity.tags"/> gives the syntax for entity-tags.619 </t>620 <t>621 A Last-Modified time, when used as a validator in a request, is622 implicitly weak unless it is possible to deduce that it is strong,623 using the following rules:624 <list style="symbols">625 <t>The validator is being compared by an origin server to the626 actual current validator for the representation and,</t>627 <t>That origin server reliably knows that the associated representation did628 not change twice during the second covered by the presented629 validator.</t>630 </list>631 </t>632 <t>633 or634 <list style="symbols">635 <t>The validator is about to be used by a client in an If-Modified-Since636 or If-Unmodified-Since header field, because the client637 has a cache entry for the associated representation, and</t>638 <t>That cache entry includes a Date value, which gives the time639 when the origin server sent the original response, and</t>640 <t>The presented Last-Modified time is at least 60 seconds before641 the Date value.</t>642 </list>643 </t>644 <t>645 or646 <list style="symbols">647 <t>The validator is being compared by an intermediate cache to the648 validator stored in its cache entry for the representation, and</t>649 <t>That cache entry includes a Date value, which gives the time650 when the origin server sent the original response, and</t>651 <t>The presented Last-Modified time is at least 60 seconds before652 the Date value.</t>653 </list>654 </t>655 <t>656 This method relies on the fact that if two different responses were657 sent by the origin server during the same second, but both had the658 same Last-Modified time, then at least one of those responses would659 have a Date value equal to its Last-Modified time. The arbitrary 60-second660 limit guards against the possibility that the Date and Last-Modified661 values are generated from different clocks, or at somewhat662 different times during the preparation of the response. An663 implementation &MAY; use a value larger than 60 seconds, if it is664 believed that 60 seconds is too short.665 </t>666 <t>667 If a client wishes to perform a sub-range retrieval on a value for668 which it has only a Last-Modified time and no opaque validator, it669 &MAY; do this only if the Last-Modified time is strong in the sense670 described here.671 </t>672 <t>673 A cache or origin server receiving a conditional range request674 (<xref target="Part5"/>) &MUST; use the strong comparison function to675 evaluate the condition.676 </t>677 <t>678 These rules allow HTTP/1.1 caches and clients to safely perform sub-range679 retrievals on values that have been obtained from HTTP/1.0680 servers.681 627 </t> 682 628 </section> … … 760 706 </section> 761 707 708 <section title="Example: Entity-tags varying on Content-Negotiated Resources" anchor="example.entity.tag.vs.conneg"> 709 <t> 710 Consider a resource that is subject to content negotiation (&content-negotiation;), 711 and where the representations returned upon a GET request vary based on 712 the Accept-Encoding request header field (&header-accept-encoding;): 713 </t> 714 <figure><preamble>>> Request:</preamble><artwork type="message/http; msgtype="request"" x:indent-with=" "> 715 GET /index HTTP/1.1 716 Host: www.example.com 717 Accept-Encoding: gzip 718 719 </artwork></figure> 720 <t> 721 In this case, the response might or might not use the gzip content coding. 722 If it does not, the response might look like: 723 </t> 724 <figure><preamble>>> Response:</preamble><artwork type="message/http; msgtype="response"" x:indent-with=" "> 725 HTTP/1.1 200 OK 726 Date: Thu, 26 Mar 2010 00:05:00 GMT 727 ETag: "123-a" 728 Content-Length: <x:length-of target="exbody"/> 729 Vary: Accept-Encoding 730 Content-Type: text/plain 731 732 <x:span anchor="exbody">Hello World! 733 Hello World! 734 Hello World! 735 Hello World! 736 Hello World! 737 </x:span></artwork></figure> 738 <t> 739 An alternative representation that does use gzip content coding would be: 740 </t> 741 <figure><preamble>>> Response:</preamble><artwork type="message/http; msgtype="response"" x:indent-with=" "> 742 HTTP/1.1 200 OK 743 Date: Thu, 26 Mar 2010 00:05:00 GMT 744 ETag: "123-b" 745 Content-Length: 43 746 Vary: Accept-Encoding 747 Content-Type: text/plain 748 Content-Encoding: gzip 749 750 <spanx>...binary data...</spanx></artwork></figure> 751 <x:note> 752 <t> 753 <x:h>Note:</x:h> Content codings are a property of the representation, 754 so therefore an entity-tag of an encoded representation must be distinct 755 from an unencoded representation to prevent conflicts during cache updates 756 and range requests. In contrast, transfer codings (&transfer-codings;) 757 apply only during message transfer and do not require distinct entity-tags. 758 </t> 759 </x:note> 760 </section> 761 </section> 762 762 </section> 763 763 … … 1006 1006 field and either an If-None-Match or an If-Modified-Since header 1007 1007 fields is undefined by this specification. 1008 </t> 1009 </section> 1010 1011 <section title="If-Range" anchor="header.if-range"> 1012 <t> 1013 The If-Range header field provides a special conditional request 1014 mechanism that is similar to If-Match and If-Unmodified-Since but 1015 specific to HTTP range requests. If-Range is defined in &header-if-range;. 1008 1016 </t> 1009 1017 </section> -
draft-ietf-httpbis/latest/p5-range.html
r1258 r1260 359 359 } 360 360 @bottom-center { 361 content: "Expires October 6, 2011";361 content: "Expires October 7, 2011"; 362 362 } 363 363 @bottom-right { … … 406 406 <meta name="dct.creator" content="Reschke, J. F."> 407 407 <meta name="dct.identifier" content="urn:ietf:id:draft-ietf-httpbis-p5-range-latest"> 408 <meta name="dct.issued" scheme="ISO8601" content="2011-04-0 4">408 <meta name="dct.issued" scheme="ISO8601" content="2011-04-05"> 409 409 <meta name="dct.replaces" content="urn:ietf:rfc:2616"> 410 410 <meta name="dct.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 5 of the seven-part specification that defines the protocol referred to as "HTTP/1.1" and, taken together, obsoletes RFC 2616. Part 5 defines range-specific requests and the rules for constructing and combining responses to those requests."> … … 432 432 </tr> 433 433 <tr> 434 <td class="left">Expires: October 6, 2011</td>434 <td class="left">Expires: October 7, 2011</td> 435 435 <td class="right">J. Mogul</td> 436 436 </tr> … … 489 489 <tr> 490 490 <td class="left"></td> 491 <td class="right">April 4, 2011</td>491 <td class="right">April 5, 2011</td> 492 492 </tr> 493 493 </tbody> … … 515 515 in progress”. 516 516 </p> 517 <p>This Internet-Draft will expire on October 6, 2011.</p>517 <p>This Internet-Draft will expire on October 7, 2011.</p> 518 518 <h1><a id="rfc.copyrightnotice" href="#rfc.copyrightnotice">Copyright Notice</a></h1> 519 519 <p>Copyright © 2011 IETF Trust and the persons identified as the document authors. All rights reserved.</p> … … 642 642 <p id="rfc.section.1.2.2.p.1">The ABNF rules below are defined in other parts:</p> 643 643 <div id="rfc.figure.u.2"></div><pre class="inline"> <a href="#abnf.dependencies" class="smpl">HTTP-date</a> = <HTTP-date, defined in <a href="#Part1" id="rfc.xref.Part1.5"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, <a href="p1-messaging.html#date.time.formats.full.date" title="Date/Time Formats: Full Date">Section 6.1</a>> 644 </pre><div id="rfc.figure.u.3"></div><pre class="inline"> <a href="#abnf.dependencies" class="smpl">entity-tag</a> = <entity-tag, defined in <a href="#Part4" id="rfc.xref.Part4.1"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>, <a href="p4-conditional.html# entity.tags" title="Entity Tags">Section 2.2</a>>644 </pre><div id="rfc.figure.u.3"></div><pre class="inline"> <a href="#abnf.dependencies" class="smpl">entity-tag</a> = <entity-tag, defined in <a href="#Part4" id="rfc.xref.Part4.1"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>, <a href="p4-conditional.html#header.etag" title="ETag">Section 2.2</a>> 645 645 </pre><h1 id="rfc.section.2"><a href="#rfc.section.2">2.</a> <a id="range.units" href="#range.units">Range Units</a></h1> 646 <p id="rfc.section.2.p.1">HTTP/1.1 allows a client to request that only part (a range of)the representation be included within the response. HTTP/1.1646 <p id="rfc.section.2.p.1">HTTP/1.1 allows a client to request that only part (a range) of the representation be included within the response. HTTP/1.1 647 647 uses range units in the Range (<a href="#header.range" id="rfc.xref.header.range.1" title="Range">Section 5.4</a>) and Content-Range (<a href="#header.content-range" id="rfc.xref.header.content-range.1" title="Content-Range">Section 5.2</a>) header fields. A representation can be broken down into subranges according to various structural units. 648 648 </p> … … 656 656 </p> 657 657 <h2 id="rfc.section.2.1"><a href="#rfc.section.2.1">2.1</a> <a id="range.specifier.registry" href="#range.specifier.registry">Range Specifier Registry</a></h2> 658 <p id="rfc.section.2.1.p.1">The HTTP Range rSpecifier Registry defines the name space for the range specifier names.</p>658 <p id="rfc.section.2.1.p.1">The HTTP Range Specifier Registry defines the name space for the range specifier names.</p> 659 659 <p id="rfc.section.2.1.p.2">Registrations <em class="bcp14">MUST</em> include the following fields: 660 660 </p> … … 712 712 <ul> 713 713 <li>Both the incoming response and the cache entry have a cache validator.</li> 714 <li>The two cache validators match using the strong comparison function (see <a href="p4-conditional.html#weak.and.strong.validators" title="Weak and Strong Validators">Section 2.3</a> of <a href="#Part4" id="rfc.xref.Part4.2"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>).714 <li>The two cache validators match using the strong comparison function (see <a href="p4-conditional.html#weak.and.strong.validators" title="Weak versus Strong">Section 2.2.2</a> of <a href="#Part4" id="rfc.xref.Part4.2"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>). 715 715 </li> 716 716 </ul> … … 827 827 </p> 828 828 <div id="rfc.figure.u.14"></div><pre class="inline"><span id="rfc.iref.g.11"></span> <a href="#header.if-range" class="smpl">If-Range</a> = <a href="#abnf.dependencies" class="smpl">entity-tag</a> / <a href="#abnf.dependencies" class="smpl">HTTP-date</a> 829 </pre><p id="rfc.section.5.3.p.4">If the client has no entity-tag for a representation, but does have a Last-Modified date, it <em class="bcp14">MAY</em> use that date in an If-Range header field. (The server can distinguish between a valid HTTP-date and any form of entity-tag 829 </pre><p id="rfc.section.5.3.p.4">Only a strong validator (<a href="p4-conditional.html#weak.and.strong.validators" title="Weak versus Strong">Section 2.2.2</a> of <a href="#Part4" id="rfc.xref.Part4.3"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>) is usable for range retrieval, since otherwise the client might end up with an internally inconsistent representation. Clients <em class="bcp14">MUST NOT</em> use weak validators in range requests. A cache or origin server receiving a conditional range request <em class="bcp14">MUST</em> use the strong comparison function to evaluate the condition. 830 </p> 831 <p id="rfc.section.5.3.p.5">If the client has no entity-tag for a representation, but does have a Last-Modified date, it <em class="bcp14">MAY</em> use that date in an If-Range header field. (The server can distinguish between a valid HTTP-date and any form of entity-tag 830 832 by examining no more than two characters.) The If-Range header field <em class="bcp14">SHOULD</em> only be used together with a Range header field, and <em class="bcp14">MUST</em> be ignored if the request does not include a Range header field, or if the server does not support the sub-range operation. 831 833 </p> 832 <p id="rfc.section.5.3.p.5">If the entity-tag given in the If-Range header field matches the current cache validator for the representation, then the 834 <p id="rfc.section.5.3.p.6">If a client wishes to perform a sub-range retrieval on a value for which it has only a Last-Modified time and no opaque validator, 835 it <em class="bcp14">MAY</em> do this only if the Last-Modified time is strong in the sense described in <a href="p4-conditional.html#lastmod.comparison" title="Comparison">Section 2.1.2</a> of <a href="#Part4" id="rfc.xref.Part4.4"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>. 836 </p> 837 <p id="rfc.section.5.3.p.7">If the entity-tag given in the If-Range header field matches the current cache validator for the representation, then the 833 838 server <em class="bcp14">SHOULD</em> provide the specified sub-range of the representation using a 206 (Partial Content) response. If the cache validator does 834 839 not match, then the server <em class="bcp14">SHOULD</em> return the entire representation using a 200 (OK) response. … … 1461 1466 </ul> 1462 1467 </li> 1463 <li><em>Part4</em> <a href="#rfc.xref.Part4.1">1.2.2</a>, <a href="#rfc.xref.Part4.2">4</a>, <a href="#Part4"><b>9.1</b></a><ul> 1468 <li><em>Part4</em> <a href="#rfc.xref.Part4.1">1.2.2</a>, <a href="#rfc.xref.Part4.2">4</a>, <a href="#rfc.xref.Part4.3">5.3</a>, <a href="#rfc.xref.Part4.4">5.3</a>, <a href="#Part4"><b>9.1</b></a><ul> 1469 <li><em>Section 2.1.2</em> <a href="#rfc.xref.Part4.4">5.3</a></li> 1464 1470 <li><em>Section 2.2</em> <a href="#rfc.xref.Part4.1">1.2.2</a></li> 1465 <li><em>Section 2. 3</em> <a href="#rfc.xref.Part4.2">4</a></li>1471 <li><em>Section 2.2.2</em> <a href="#rfc.xref.Part4.2">4</a>, <a href="#rfc.xref.Part4.3">5.3</a></li> 1466 1472 </ul> 1467 1473 </li> -
draft-ietf-httpbis/latest/p5-range.xml
r1258 r1260 20 20 <!ENTITY full-date "<xref target='Part1' x:rel='#date.time.formats.full.date' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 21 21 <!ENTITY messaging "<xref target='Part1' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 22 <!ENTITY entity-tags "<xref target='Part4' x:rel='# entity.tags' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">22 <!ENTITY entity-tags "<xref target='Part4' x:rel='#header.etag' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 23 23 <!ENTITY weak-and-strong-validators "<xref target='Part4' x:rel='#weak.and.strong.validators' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 24 <!ENTITY lastmod-comparison "<xref target='Part4' x:rel='#lastmod.comparison' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 24 25 ]> 25 26 <?rfc toc="yes" ?> … … 313 314 <x:anchor-alias value="range-unit"/> 314 315 <t> 315 HTTP/1.1 allows a client to request that only part (a range of)the316 HTTP/1.1 allows a client to request that only part (a range) of the 316 317 representation be included within the response. HTTP/1.1 uses range 317 318 units in the Range (<xref target="header.range"/>) and Content-Range (<xref target="header.content-range"/>) … … 339 340 <section title="Range Specifier Registry" anchor="range.specifier.registry"> 340 341 <t> 341 The HTTP Range rSpecifier Registry defines the name space for the range342 The HTTP Range Specifier Registry defines the name space for the range 342 343 specifier names. 343 344 </t> … … 678 679 </artwork></figure> 679 680 <t> 681 Only a strong validator (&weak-and-strong-validators;) is usable for 682 range retrieval, since otherwise the client might end up with an 683 internally inconsistent representation. 684 Clients &MUST-NOT; use weak validators in range requests. 685 A cache or origin server receiving a conditional range request 686 &MUST; use the strong comparison function to evaluate the condition. 687 </t> 688 <t> 680 689 If the client has no entity-tag for a representation, but does have a Last-Modified 681 690 date, it &MAY; use that date in an If-Range header field. (The … … 685 694 ignored if the request does not include a Range header field, or if the 686 695 server does not support the sub-range operation. 696 </t> 697 <t> 698 If a client wishes to perform a sub-range retrieval on a value for 699 which it has only a Last-Modified time and no opaque validator, it 700 &MAY; do this only if the Last-Modified time is strong in the sense 701 described in &lastmod-comparison;. 687 702 </t> 688 703 <t> -
draft-ietf-httpbis/latest/p6-cache.html
r1258 r1260 362 362 } 363 363 @bottom-center { 364 content: "Expires October 6, 2011";364 content: "Expires October 7, 2011"; 365 365 } 366 366 @bottom-right { … … 408 408 <meta name="dct.creator" content="Reschke, J. F."> 409 409 <meta name="dct.identifier" content="urn:ietf:id:draft-ietf-httpbis-p6-cache-latest"> 410 <meta name="dct.issued" scheme="ISO8601" content="2011-04-0 4">410 <meta name="dct.issued" scheme="ISO8601" content="2011-04-05"> 411 411 <meta name="dct.replaces" content="urn:ietf:rfc:2616"> 412 412 <meta name="dct.abstract" content="The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. This document is Part 6 of the seven-part specification that defines the protocol referred to as "HTTP/1.1" and, taken together, obsoletes RFC 2616. Part 6 defines requirements on HTTP caches and the associated header fields that control cache behavior or indicate cacheable response messages."> … … 434 434 </tr> 435 435 <tr> 436 <td class="left">Expires: October 6, 2011</td>436 <td class="left">Expires: October 7, 2011</td> 437 437 <td class="right">J. Mogul</td> 438 438 </tr> … … 495 495 <tr> 496 496 <td class="left"></td> 497 <td class="right">April 4, 2011</td>497 <td class="right">April 5, 2011</td> 498 498 </tr> 499 499 </tbody> … … 521 521 in progress”. 522 522 </p> 523 <p>This Internet-Draft will expire on October 6, 2011.</p>523 <p>This Internet-Draft will expire on October 7, 2011.</p> 524 524 <h1><a id="rfc.copyrightnotice" href="#rfc.copyrightnotice">Copyright Notice</a></h1> 525 525 <p>Copyright © 2011 IETF Trust and the persons identified as the document authors. All rights reserved.</p> … … 1021 1021 <p id="rfc.section.2.8.p.2">If the new response contains an ETag, it identifies the stored response to use. <span class="comment" id="TODO-mention-CL">[<a href="#TODO-mention-CL" class="smpl">TODO-mention-CL</a>: might need language about Content-Location here]</span><span class="comment" id="TODO-select-for-combine">[<a href="#TODO-select-for-combine" class="smpl">TODO-select-for-combine</a>: Shouldn't this be the selected response?]</span> 1022 1022 </p> 1023 <p id="rfc.section.2.8.p.3">When the new response's status code is 206 (partial content), a cache <em class="bcp14">MUST NOT</em> combine it with the old response if either response does not have a validator, and <em class="bcp14">MUST NOT</em> combine it with the old response when those validators do not match with the strong comparison function (see <a href="p4-conditional.html#weak.and.strong.validators" title="Weak and Strong Validators">Section 2.3</a> of <a href="#Part4" id="rfc.xref.Part4.3"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>).1023 <p id="rfc.section.2.8.p.3">When the new response's status code is 206 (partial content), a cache <em class="bcp14">MUST NOT</em> combine it with the old response if either response does not have a validator, and <em class="bcp14">MUST NOT</em> combine it with the old response when those validators do not match with the strong comparison function (see <a href="p4-conditional.html#weak.and.strong.validators" title="Weak versus Strong">Section 2.2.2</a> of <a href="#Part4" id="rfc.xref.Part4.3"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>). 1024 1024 </p> 1025 1025 <p id="rfc.section.2.8.p.4">The stored response header fields are used as those of the updated response, except that </p> … … 2094 2094 <li><em>Part4</em> <a href="#rfc.xref.Part4.1">2.3.1.1</a>, <a href="#rfc.xref.Part4.2">2.4</a>, <a href="#rfc.xref.Part4.3">2.8</a>, <a href="#Part4"><b>8.1</b></a><ul> 2095 2095 <li><em>Section 2.1</em> <a href="#rfc.xref.Part4.1">2.3.1.1</a></li> 2096 <li><em>Section 2. 3</em> <a href="#rfc.xref.Part4.3">2.8</a></li>2096 <li><em>Section 2.2.2</em> <a href="#rfc.xref.Part4.3">2.8</a></li> 2097 2097 </ul> 2098 2098 </li> -
draft-ietf-httpbis/latest/p7-auth.html
r1258 r1260 359 359 } 360 360 @bottom-center { 361 content: "Expires October 6, 2011";361 content: "Expires October 7, 2011"; 362 362 } 363 363 @bottom-right { … … 404 404 <meta name="dct.creator" content="Reschke, J. F."> 405 405 <meta name="dct.identifier" content="urn:ietf:id:draft-ietf-httpbis-p7-auth-latest"> 406 <meta name="dct.issued" scheme="ISO8601" content="2011-04-0 4">406 <meta name="dct.issued" scheme="ISO8601" content="2011-04-05"> 407 407 <meta name="dct.replaces" content="urn:ietf:rfc:2616"> 408 408 <meta name="dct.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 7 of the seven-part specification that defines the protocol referred to as "HTTP/1.1" and, taken together, obsoletes RFC 2616. Part 7 defines HTTP Authentication."> … … 435 435 </tr> 436 436 <tr> 437 <td class="left">Expires: October 6, 2011</td>437 <td class="left">Expires: October 7, 2011</td> 438 438 <td class="right">HP</td> 439 439 </tr> … … 488 488 <tr> 489 489 <td class="left"></td> 490 <td class="right">April 4, 2011</td>490 <td class="right">April 5, 2011</td> 491 491 </tr> 492 492 </tbody> … … 514 514 in progress”. 515 515 </p> 516 <p>This Internet-Draft will expire on October 6, 2011.</p>516 <p>This Internet-Draft will expire on October 7, 2011.</p> 517 517 <h1><a id="rfc.copyrightnotice" href="#rfc.copyrightnotice">Copyright Notice</a></h1> 518 518 <p>Copyright © 2011 IETF Trust and the persons identified as the document authors. All rights reserved.</p>
Note: See TracChangeset
for help on using the changeset viewer.