Ignore:
Timestamp:
Jul 8, 2012, 7:50:41 AM (7 years ago)
Author:
julian.reschke@…
Message:

Work-in-progress: hyperlink header field definitions(P4)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • draft-ietf-httpbis/latest/p4-conditional.html

    r1738 r1739  
    769769      <p id="rfc.section.2.2.2.p.2">or </p>
    770770      <ul>
    771          <li>The validator is about to be used by a client in an If-Modified-Since, If-Unmodified-Since header field, because the client
    772             has a cache entry, or <a href="p5-range.html#header.if-range" class="smpl">If-Range</a> for the associated representation, and
     771         <li>The validator is about to be used by a client in an <a href="#header.if-modified-since" class="smpl">If-Modified-Since</a>, <a href="#header.if-unmodified-since" class="smpl">If-Unmodified-Since</a> header field, because the client has a cache entry, or <a href="p5-range.html#header.if-range" class="smpl">If-Range</a> for the associated representation, and
    773772         </li>
    774773         <li>That cache entry includes a Date value, which gives the time when the origin server sent the original response, and</li>
     
    932931            or if it is unfeasible to send a strong entity-tag.
    933932         </li>
    934          <li><em class="bcp14">SHOULD</em> send a Last-Modified value if it is feasible to send one.
     933         <li><em class="bcp14">SHOULD</em> send a <a href="#header.last-modified" class="smpl">Last-Modified</a> value if it is feasible to send one.
    935934         </li>
    936935      </ul>
    937       <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-Modified
    938          value.
     936      <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 <a href="#header.last-modified" class="smpl">Last-Modified</a> value.
    939937      </p>
    940938      <p id="rfc.section.2.4.p.4">HTTP/1.1 clients: </p>
    941939      <ul>
    942          <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
    943             by the origin server.
    944          </li>
    945          <li><em class="bcp14">SHOULD</em> use the Last-Modified value in non-subrange cache-conditional requests (using If-Modified-Since) if only a Last-Modified value
    946             has been provided by the origin server.
    947          </li>
    948          <li><em class="bcp14">MAY</em> use the Last-Modified value in subrange cache-conditional requests (using If-Unmodified-Since) if only a Last-Modified value
    949             has been provided by an HTTP/1.0 origin server. The user agent <em class="bcp14">SHOULD</em> provide a way to disable this, in case of difficulty.
    950          </li>
    951          <li><em class="bcp14">SHOULD</em> use both validators in cache-conditional requests if both an entity-tag and a Last-Modified value have been provided by the
    952             origin server. This allows both HTTP/1.0 and HTTP/1.1 caches to respond appropriately.
     940         <li><em class="bcp14">MUST</em> use that entity-tag in any cache-conditional request (using <a href="#header.if-match" class="smpl">If-Match</a> or <a href="#header.if-none-match" class="smpl">If-None-Match</a>) if an entity-tag has been provided by the origin server.
     941         </li>
     942         <li><em class="bcp14">SHOULD</em> use the <a href="#header.last-modified" class="smpl">Last-Modified</a> value in non-subrange cache-conditional requests (using <a href="#header.if-modified-since" class="smpl">If-Modified-Since</a>) if only a Last-Modified value has been provided by the origin server.
     943         </li>
     944         <li><em class="bcp14">MAY</em> use the <a href="#header.last-modified" class="smpl">Last-Modified</a> value in subrange cache-conditional requests (using <a href="#header.if-unmodified-since" class="smpl">If-Unmodified-Since</a>) if only a Last-Modified value has been provided by an HTTP/1.0 origin server. The user agent <em class="bcp14">SHOULD</em> provide a way to disable this, in case of difficulty.
     945         </li>
     946         <li><em class="bcp14">SHOULD</em> use both validators in cache-conditional requests if both an entity-tag and a <a href="#header.last-modified" class="smpl">Last-Modified</a> value have been provided by the origin server. This allows both HTTP/1.0 and HTTP/1.1 caches to respond appropriately.
    953947         </li>
    954948      </ul>
    955       <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-Since
    956          or If-Unmodified-Since header field) and one or more entity-tags (e.g., in an If-Match, If-None-Match, or <a href="p5-range.html#header.if-range" class="smpl">If-Range</a> header field) as cache validators, <em class="bcp14">MUST NOT</em> return a response status code of <a href="#status.304" class="smpl">304 (Not Modified)</a> unless doing so is consistent with all of the conditional header fields in the request.
     949      <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 <a href="#header.if-modified-since" class="smpl">If-Modified-Since</a> or <a href="#header.if-unmodified-since" class="smpl">If-Unmodified-Since</a> header field) and one or more entity-tags (e.g., in an <a href="#header.if-match" class="smpl">If-Match</a>, <a href="#header.if-none-match" class="smpl">If-None-Match</a>, or <a href="p5-range.html#header.if-range" class="smpl">If-Range</a> header field) as cache validators, <em class="bcp14">MUST NOT</em> return a response status code of <a href="#status.304" class="smpl">304 (Not Modified)</a> unless doing so is consistent with all of the conditional header fields in the request.
    957950      </p>
    958951      <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-tags
     
    996989  If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
    997990  If-Match: *
    998 </pre><p id="rfc.section.3.1.p.9">The result of a request having both an If-Match header field and either an If-None-Match or an If-Modified-Since header field
    999          is undefined by this specification.
     991</pre><p id="rfc.section.3.1.p.9">The result of a request having both an If-Match header field and either an <a href="#header.if-none-match" class="smpl">If-None-Match</a> or an <a href="#header.if-modified-since" class="smpl">If-Modified-Since</a> header field is undefined by this specification.
    1000992      </p>
    1001993      <div id="rfc.iref.i.2"></div>
     
    10151007      <div id="rfc.figure.u.11"></div><pre class="inline"><span id="rfc.iref.g.8"></span>  <a href="#header.if-none-match" class="smpl">If-None-Match</a> = "*" / 1#<a href="#header.etag" class="smpl">entity-tag</a>
    10161008</pre><p id="rfc.section.3.2.p.4">If any of the entity-tags listed in the If-None-Match field-value match (as per <a href="#entity.tag.comparison" title="Comparison">Section&nbsp;2.3.2</a>) the entity-tag of the selected representation, or if "*" is given and any current representation exists for that resource,
    1017          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 <a href="#status.304" class="smpl">304 (Not Modified)</a> status code, including the cache-related header fields (particularly ETag) of the selected representation that has a matching
    1018          entity-tag. For all other request methods, the server <em class="bcp14">MUST</em> respond with a <a href="#status.412" class="smpl">412 (Precondition Failed)</a> status code.
    1019       </p>
    1020       <p id="rfc.section.3.2.p.5">If none of the entity-tags match, then the server <em class="bcp14">MAY</em> perform the requested method as if the If-None-Match header field did not exist, but <em class="bcp14">MUST</em> also ignore any If-Modified-Since header field(s) in the request. That is, if no entity-tags match, then the server <em class="bcp14">MUST NOT</em> return a <a href="#status.304" class="smpl">304 (Not Modified)</a> response.
    1021       </p>
    1022       <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 <a href="p2-semantics.html#status.2xx" class="smpl">2xx (Successful)</a> or <a href="#status.304" class="smpl">304 (Not Modified)</a> status code, then 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&nbsp;2.4</a> for a discussion of server behavior when both If-Modified-Since and If-None-Match appear in the same request.)
     1009         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 <a href="#status.304" class="smpl">304 (Not Modified)</a> status code, including the cache-related header fields (particularly <a href="#header.etag" class="smpl">ETag</a>) of the selected representation that has a matching entity-tag. For all other request methods, the server <em class="bcp14">MUST</em> respond with a <a href="#status.412" class="smpl">412 (Precondition Failed)</a> status code.
     1010      </p>
     1011      <p id="rfc.section.3.2.p.5">If none of the entity-tags match, then the server <em class="bcp14">MAY</em> perform the requested method as if the If-None-Match header field did not exist, but <em class="bcp14">MUST</em> also ignore any <a href="#header.if-modified-since" class="smpl">If-Modified-Since</a> header field(s) in the request. That is, if no entity-tags match, then the server <em class="bcp14">MUST NOT</em> return a <a href="#status.304" class="smpl">304 (Not Modified)</a> response.
     1012      </p>
     1013      <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 <a href="p2-semantics.html#status.2xx" class="smpl">2xx (Successful)</a> or <a href="#status.304" class="smpl">304 (Not Modified)</a> status code, then 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&nbsp;2.4</a> for a discussion of server behavior when both <a href="#header.if-modified-since" class="smpl">If-Modified-Since</a> and If-None-Match appear in the same request.)
    10231014      </p>
    10241015      <p id="rfc.section.3.2.p.7">Examples:</p>
     
    10281019  If-None-Match: W/"xyzzy", W/"r2d2xxxx", W/"c3piozzzz"
    10291020  If-None-Match: *
    1030 </pre><p id="rfc.section.3.2.p.9">The result of a request having both an If-None-Match header field and either an If-Match or an If-Unmodified-Since header
    1031          field is undefined by this specification.
     1021</pre><p id="rfc.section.3.2.p.9">The result of a request having both an If-None-Match header field and either an <a href="#header.if-match" class="smpl">If-Match</a> or an <a href="#header.if-unmodified-since" class="smpl">If-Unmodified-Since</a> header field is undefined by this specification.
    10321022      </p>
    10331023      <div id="rfc.iref.i.3"></div>
     
    10621052         <li> <b>Note:</b> When handling an If-Modified-Since header field, some servers will use an exact date comparison function, rather than a less-than
    10631053            function, for deciding whether to send a <a href="#status.304" class="smpl">304 (Not Modified)</a> response. To get best results when sending an If-Modified-Since header field for cache validation, clients are advised to
    1064             use the exact date string received in a previous Last-Modified header field whenever possible.
    1065          </li>
    1066          <li> <b>Note:</b> If a client uses an arbitrary date in the If-Modified-Since header field instead of a date taken from the Last-Modified header
    1067             field for the same request, the client needs to be aware that this date is interpreted in the server's understanding of time.
    1068             Unsynchronized clocks and rounding problems, due to the different encodings of time between the client and server, are concerns.
    1069             This includes the possibility of race conditions if the document has changed between the time it was first requested and the
    1070             If-Modified-Since date of a subsequent request, and the possibility of clock-skew-related problems if the If-Modified-Since
     1054            use the exact date string received in a previous <a href="#header.last-modified" class="smpl">Last-Modified</a> header field whenever possible.
     1055         </li>
     1056         <li> <b>Note:</b> If a client uses an arbitrary date in the If-Modified-Since header field instead of a date taken from the <a href="#header.last-modified" class="smpl">Last-Modified</a> header field for the same request, the client needs to be aware that this date is interpreted in the server's understanding
     1057            of time. Unsynchronized clocks and rounding problems, due to the different encodings of time between the client and server,
     1058            are concerns. This includes the possibility of race conditions if the document has changed between the time it was first requested
     1059            and the If-Modified-Since date of a subsequent request, and the possibility of clock-skew-related problems if the If-Modified-Since
    10711060            date is derived from the client's clock without correction to the server's clock. Corrections for different time bases between
    10721061            client and server are at best approximate due to network latency.
    10731062         </li>
    10741063      </ul>
    1075       <p id="rfc.section.3.3.p.7">The result of a request having both an If-Modified-Since header field and either an If-Match or an If-Unmodified-Since header
    1076          field is undefined by this specification.
     1064      <p id="rfc.section.3.3.p.7">The result of a request having both an If-Modified-Since header field and either an <a href="#header.if-match" class="smpl">If-Match</a> or an <a href="#header.if-unmodified-since" class="smpl">If-Unmodified-Since</a> header field is undefined by this specification.
    10771065      </p>
    10781066      <div id="rfc.iref.i.4"></div>
     
    10891077      <p id="rfc.section.3.4.p.6">If the specified date is invalid, the header field <em class="bcp14">MUST</em> be ignored.
    10901078      </p>
    1091       <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
    1092          header field is undefined by this specification.
     1079      <p id="rfc.section.3.4.p.7">The result of a request having both an If-Unmodified-Since header field and either an <a href="#header.if-none-match" class="smpl">If-None-Match</a> or an <a href="#header.if-modified-since" class="smpl">If-Modified-Since</a> header field is undefined by this specification.
    10931080      </p>
    10941081      <h2 id="rfc.section.3.5"><a href="#rfc.section.3.5">3.5</a>&nbsp;<a id="header.if-range" href="#header.if-range">If-Range</a></h2>
    1095       <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
    1096          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>.
     1082      <p id="rfc.section.3.5.p.1">The "If-Range" header field provides a special conditional request mechanism that is similar to <a href="#header.if-match" class="smpl">If-Match</a> and <a href="#header.if-unmodified-since" class="smpl">If-Unmodified-Since</a> 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>.
    10971083      </p>
    10981084      <h1 id="rfc.section.4"><a href="#rfc.section.4">4.</a>&nbsp;<a id="status.code.definitions" href="#status.code.definitions">Status Code Definitions</a></h1>
     
    11051091         as if it were the payload of a 200 response. The 304 response <em class="bcp14">MUST NOT</em> contain a message-body, and thus is always terminated by the first empty line after the header fields.
    11061092      </p>
    1107       <p id="rfc.section.4.1.p.2">A 304 response <em class="bcp14">MUST</em> include a Date header field (<a href="p2-semantics.html#header.date" title="Date">Section 9.10</a> of <a href="#Part2" id="rfc.xref.Part2.5"><cite title="HTTP/1.1, part 2: Message Semantics, Payload and Content Negotiation">[Part2]</cite></a>) unless the origin server does not have a clock that can provide a reasonable approximation of the current time. If a <a href="p2-semantics.html#status.200" class="smpl">200 (OK)</a> response to the same request would have included any of the header fields Cache-Control, Content-Location, ETag, <a href="p6-cache.html#header.expires" class="smpl">Expires</a>, or <a href="p6-cache.html#header.vary" class="smpl">Vary</a>, then those same header fields <em class="bcp14">MUST</em> be sent in a 304 response.
     1093      <p id="rfc.section.4.1.p.2">A 304 response <em class="bcp14">MUST</em> include a Date header field (<a href="p2-semantics.html#header.date" title="Date">Section 9.10</a> of <a href="#Part2" id="rfc.xref.Part2.5"><cite title="HTTP/1.1, part 2: Message Semantics, Payload and Content Negotiation">[Part2]</cite></a>) unless the origin server does not have a clock that can provide a reasonable approximation of the current time. If a <a href="p2-semantics.html#status.200" class="smpl">200 (OK)</a> response to the same request would have included any of the header fields <a href="p6-cache.html#header.cache-control" class="smpl">Cache-Control</a>, Content-Location, <a href="#header.etag" class="smpl">ETag</a>, <a href="p6-cache.html#header.expires" class="smpl">Expires</a>, or <a href="p6-cache.html#header.vary" class="smpl">Vary</a>, then those same header fields <em class="bcp14">MUST</em> be sent in a 304 response.
    11081094      </p>
    11091095      <p id="rfc.section.4.1.p.3">Since the goal of a 304 response is to minimize information transfer when the recipient already has one or more cached representations,
     
    12911277      <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.1</a> and <a href="#header.if-none-match" id="rfc.xref.header.if-none-match.2" title="If-None-Match">3.2</a>).
    12921278      </p>
    1293       <p id="rfc.section.A.p.2">Change ETag header field ABNF not to use quoted-string, thus avoiding escaping issues. (<a href="#header.etag" id="rfc.xref.header.etag.3" title="ETag">Section&nbsp;2.3</a>)
     1279      <p id="rfc.section.A.p.2">Change <a href="#header.etag" class="smpl">ETag</a> header field ABNF not to use quoted-string, thus avoiding escaping issues. (<a href="#header.etag" id="rfc.xref.header.etag.3" title="ETag">Section&nbsp;2.3</a>)
    12941280      </p>
    12951281      <p id="rfc.section.A.p.3">Change ABNF productions for header fields to only define the field value. (<a href="#header.field.definitions" title="Precondition Header Fields">Section&nbsp;3</a>)
Note: See TracChangeset for help on using the changeset viewer.