source: draft-ietf-httpbis/latest/p4-conditional.xml @ 38

Last change on this file since 38 was 36, checked in by fielding@…, 15 years ago

Add an editorial note about status and list.
Streamline the new references and place them up front.

  • Property svn:eol-style set to native
File size: 42.5 KB
1<?xml version="1.0" encoding="utf-8"?>
2<!DOCTYPE rfc [
3  <!ENTITY MAY "<bcp14 xmlns=''>MAY</bcp14>">
4  <!ENTITY MUST "<bcp14 xmlns=''>MUST</bcp14>">
5  <!ENTITY MUST-NOT "<bcp14 xmlns=''>MUST NOT</bcp14>">
6  <!ENTITY OPTIONAL "<bcp14 xmlns=''>OPTIONAL</bcp14>">
7  <!ENTITY RECOMMENDED "<bcp14 xmlns=''>RECOMMENDED</bcp14>">
8  <!ENTITY REQUIRED "<bcp14 xmlns=''>REQUIRED</bcp14>">
9  <!ENTITY SHALL "<bcp14 xmlns=''>SHALL</bcp14>">
10  <!ENTITY SHALL-NOT "<bcp14 xmlns=''>SHALL NOT</bcp14>">
11  <!ENTITY SHOULD "<bcp14 xmlns=''>SHOULD</bcp14>">
12  <!ENTITY SHOULD-NOT "<bcp14 xmlns=''>SHOULD NOT</bcp14>">
13  <!ENTITY ID-VERSION "latest">
14  <!ENTITY ID-MONTH "December">
15  <!ENTITY ID-YEAR "2007">
16  <!ENTITY messaging                  "<xref target='Part1' xmlns:x=''/>">
17  <!ENTITY header-if-range            "<xref target='Part5' x:rel='#header.if-range' xmlns:x=''/>">
18  <!ENTITY header-range               "<xref target='Part5' x:rel='#header.range' xmlns:x=''/>">
19  <!ENTITY header-vary                "<xref target='Part6' x:rel='#header.vary' xmlns:x=''/>">
21<?rfc toc="yes" ?>
22<?rfc symrefs="yes" ?>
23<?rfc sortrefs="yes" ?>
24<?rfc compact="yes"?>
25<?rfc subcompact="no" ?>
26<?rfc linkmailto="no" ?>
27<?rfc editing="no" ?>
28<?rfc-ext allow-markup-in-artwork="yes" ?>
29<?rfc-ext include-references-in-index="yes" ?>
30<rfc obsoletes="2068, 2616, 2617" category="std"
31     ipr="full3978" docName="draft-ietf-httpbis-p4-conditional-&ID-VERSION;"
32     xmlns:x='' xmlns:ed="">
35  <title abbrev="HTTP/1.1, part 4">HTTP/1.1, part 4: Conditional Requests</title>
37  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
38    <organization abbrev="Day Software">Day Software</organization>
39    <address>
40      <postal>
41        <street>23 Corporate Plaza DR, Suite 280</street>
42        <city>Newport Beach</city>
43        <region>CA</region>
44        <code>92660</code>
45        <country>USA</country>
46      </postal>
47      <phone>+1-949-706-5300</phone>
48      <facsimile>+1-949-706-5305</facsimile>
49      <email></email>
50      <uri></uri>
51    </address>
52  </author>
54  <author initials="J." surname="Gettys" fullname="Jim Gettys">
55    <organization>One Laptop per Child</organization>
56    <address>
57      <postal>
58        <street>21 Oak Knoll Road</street>
59        <city>Carlisle</city>
60        <region>MA</region>
61        <code>01741</code>
62        <country>USA</country>
63      </postal>
64      <email></email>
65      <uri></uri>
66    </address>
67  </author>
69  <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
70    <organization abbrev="HP">Hewlett-Packard Company</organization>
71    <address>
72      <postal>
73        <street>HP Labs, Large Scale Systems Group</street>
74        <street>1501 Page Mill Road, MS 1177</street>
75        <city>Palo Alto</city>
76        <region>CA</region>
77        <code>94304</code>
78        <country>USA</country>
79      </postal>
80      <email></email>
81    </address>
82  </author>
84  <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
85    <organization abbrev="Microsoft">Microsoft Corporation</organization>
86    <address>
87      <postal>
88        <street>1 Microsoft Way</street>
89        <city>Redmond</city>
90        <region>WA</region>
91        <code>98052</code>
92        <country>USA</country>
93      </postal>
94      <email></email>
95    </address>
96  </author>
98  <author initials="L." surname="Masinter" fullname="Larry Masinter">
99    <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
100    <address>
101      <postal>
102        <street>345 Park Ave</street>
103        <city>San Jose</city>
104        <region>CA</region>
105        <code>95110</code>
106        <country>USA</country>
107      </postal>
108      <email></email>
109      <uri></uri>
110    </address>
111  </author>
113  <author initials="P." surname="Leach" fullname="Paul J. Leach">
114    <organization abbrev="Microsoft">Microsoft Corporation</organization>
115    <address>
116      <postal>
117        <street>1 Microsoft Way</street>
118        <city>Redmond</city>
119        <region>WA</region>
120        <code>98052</code>
121      </postal>
122      <email></email>
123    </address>
124  </author>
126  <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
127    <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
128    <address>
129      <postal>
130        <street>MIT Computer Science and Artificial Intelligence Laboratory</street>
131        <street>The Stata Center, Building 32</street>
132        <street>32 Vassar Street</street>
133        <city>Cambridge</city>
134        <region>MA</region>
135        <code>02139</code>
136        <country>USA</country>
137      </postal>
138      <email></email>
139      <uri></uri>
140    </address>
141  </author>
143  <date month="&ID-MONTH;" year="&ID-YEAR;"/>
147   The Hypertext Transfer Protocol (HTTP) is an application-level
148   protocol for distributed, collaborative, hypermedia information
149   systems. HTTP has been in use by the World Wide Web global information
150   initiative since 1990. This document is Part 4 of the seven-part specification
151   that defines the protocol referred to as "HTTP/1.1" and, taken together,
152   obsoletes RFC 2616 and RFC 2617.  Part 4 defines request header fields for
153   indicating conditional requests and the rules for constructing responses
154   to those requests.
158<note title="Editorial Note (To be removed by RFC Editor)">
159  <t>
160    This version of the HTTP specification contains only minimal editorial
161    changes from <xref target="RFC2616"/> (abstract, introductory paragraph,
162    and authors' addresses).  All other changes are due to partitioning the
163    original into seven mostly independent parts.  The intent is for readers
164    of future drafts to able to use draft 00 as the basis for comparison
165    when the WG makes later changes to the specification text.  This draft
166    will shortly be followed by draft 01 (containing the first round of changes
167    that have already been agreed to on the mailing list). There is no point in
168    reviewing this draft other than to verify that the partitioning has been
169    done correctly.  Roy T. Fielding, Yves Lafon, and Julian Reschke
170    will be the editors after draft 00 is submitted.
171  </t>
172  <t>
173    Discussion of this draft should take place on the HTTPBIS working group
174    mailing list ( The current issues list is
175    at <eref target=""/>
176    and related documents (including fancy diffs) can be found at
177    <eref target=""/>.
178  </t>
182<section title="Introduction" anchor="introduction">
184   This document will define aspects of HTTP related to conditional
185   request messages based on time stamps and entity-tags.  Right now it
186   only includes the extracted relevant sections of <xref target="RFC2616">RFC 2616</xref>
187   without edit.
191<section title="Entity Tags" anchor="entity.tags">
193   Entity tags are used for comparing two or more entities from the same
194   requested resource. HTTP/1.1 uses entity tags in the ETag (<xref target="header.etag"/>),
195   If-Match (<xref target="header.if-match"/>), If-None-Match (<xref target="header.if-none-match"/>), and
196   If-Range (&header-if-range;) header fields. The definition of how they
197   are used and compared as cache validators is in <xref target="weak.and.strong.validators"/>. An
198   entity tag consists of an opaque quoted string, possibly prefixed by
199   a weakness indicator.
201<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"/>
202   entity-tag = [ weak ] opaque-tag
203   weak       = "W/"
204   opaque-tag = quoted-string
207   A "strong entity tag" &MAY; be shared by two entities of a resource
208   only if they are equivalent by octet equality.
211   A "weak entity tag," indicated by the "W/" prefix, &MAY; be shared by
212   two entities of a resource only if the entities are equivalent and
213   could be substituted for each other with no significant change in
214   semantics. A weak entity tag can only be used for weak comparison.
217   An entity tag &MUST; be unique across all versions of all entities
218   associated with a particular resource. A given entity tag value &MAY;
219   be used for entities obtained by requests on different URIs. The use
220   of the same entity tag value in conjunction with entities obtained by
221   requests on different URIs does not imply the equivalence of those
222   entities.
226<section title="Weak and Strong Validators" anchor="weak.and.strong.validators">
228   Since both origin servers and caches will compare two validators to
229   decide if they represent the same or different entities, one normally
230   would expect that if the entity (the entity-body or any entity-headers)
231   changes in any way, then the associated validator would
232   change as well. If this is true, then we call this validator a
233   "strong validator."
236   However, there might be cases when a server prefers to change the
237   validator only on semantically significant changes, and not when
238   insignificant aspects of the entity change. A validator that does not
239   always change when the resource changes is a "weak validator."
242   Entity tags are normally "strong validators," but the protocol
243   provides a mechanism to tag an entity tag as "weak." One can think of
244   a strong validator as one that changes whenever the bits of an entity
245   changes, while a weak value changes whenever the meaning of an entity
246   changes. Alternatively, one can think of a strong validator as part
247   of an identifier for a specific entity, while a weak validator is
248   part of an identifier for a set of semantically equivalent entities.
249  <list><t>
250      <x:h>Note:</x:h> One example of a strong validator is an integer that is
251      incremented in stable storage every time an entity is changed.
252    </t><t>
253      An entity's modification time, if represented with one-second
254      resolution, could be a weak validator, since it is possible that
255      the resource might be modified twice during a single second.
256    </t><t>
257      Support for weak validators is optional. However, weak validators
258      allow for more efficient caching of equivalent objects; for
259      example, a hit counter on a site is probably good enough if it is
260      updated every few days or weeks, and any value during that period
261      is likely "good enough" to be equivalent.
262    </t></list>
265   A "use" of a validator is either when a client generates a request
266   and includes the validator in a validating header field, or when a
267   server compares two validators.
270   Strong validators are usable in any context. Weak validators are only
271   usable in contexts that do not depend on exact equality of an entity.
272   For example, either kind is usable for a conditional GET of a full
273   entity. However, only a strong validator is usable for a sub-range
274   retrieval, since otherwise the client might end up with an internally
275   inconsistent entity.
278   Clients &MAY; issue simple (non-subrange) GET requests with either weak
279   validators or strong validators. Clients &MUST-NOT; use weak validators
280   in other forms of request.
283   The only function that the HTTP/1.1 protocol defines on validators is
284   comparison. There are two validator comparison functions, depending
285   on whether the comparison context allows the use of weak validators
286   or not:
287  <list style="symbols">
288     <t>The strong comparison function: in order to be considered equal,
289        both validators &MUST; be identical in every way, and both &MUST-NOT;
290        be weak.</t>
291     <t>The weak comparison function: in order to be considered equal,
292        both validators &MUST; be identical in every way, but either or
293        both of them &MAY; be tagged as "weak" without affecting the
294        result.</t>
295  </list>
298   An entity tag is strong unless it is explicitly tagged as weak.
299   <xref target="entity.tags"/> gives the syntax for entity tags.
302   A Last-Modified time, when used as a validator in a request, is
303   implicitly weak unless it is possible to deduce that it is strong,
304   using the following rules:
305  <list style="symbols">
306     <t>The validator is being compared by an origin server to the
307        actual current validator for the entity and,</t>
308     <t>That origin server reliably knows that the associated entity did
309        not change twice during the second covered by the presented
310        validator.</t>
311  </list>
314   or
315  <list style="symbols">
316     <t>The validator is about to be used by a client in an If-Modified-Since
317        or If-Unmodified-Since header, because the client
318        has a cache entry for the associated entity, and</t>
319     <t>That cache entry includes a Date value, which gives the time
320        when the origin server sent the original response, and</t>
321     <t>The presented Last-Modified time is at least 60 seconds before
322        the Date value.</t>
323  </list>
326   or
327  <list style="symbols">
328     <t>The validator is being compared by an intermediate cache to the
329        validator stored in its cache entry for the entity, and</t>
330     <t>That cache entry includes a Date value, which gives the time
331        when the origin server sent the original response, and</t>
332     <t>The presented Last-Modified time is at least 60 seconds before
333        the Date value.</t>
334  </list>
337   This method relies on the fact that if two different responses were
338   sent by the origin server during the same second, but both had the
339   same Last-Modified time, then at least one of those responses would
340   have a Date value equal to its Last-Modified time. The arbitrary 60-second
341   limit guards against the possibility that the Date and Last-Modified
342   values are generated from different clocks, or at somewhat
343   different times during the preparation of the response. An
344   implementation &MAY; use a value larger than 60 seconds, if it is
345   believed that 60 seconds is too short.
348   If a client wishes to perform a sub-range retrieval on a value for
349   which it has only a Last-Modified time and no opaque validator, it
350   &MAY; do this only if the Last-Modified time is strong in the sense
351   described here.
354   A cache or origin server receiving a conditional request, other than
355   a full-body GET request, &MUST; use the strong comparison function to
356   evaluate the condition.
359   These rules allow HTTP/1.1 caches and clients to safely perform sub-range
360   retrievals on values that have been obtained from HTTP/1.0
361   servers.
365<section title="Rules for When to Use Entity Tags and Last-Modified Dates" anchor="">
367   We adopt a set of rules and recommendations for origin servers,
368   clients, and caches regarding when various validator types ought to
369   be used, and for what purposes.
372   HTTP/1.1 origin servers:
373  <list style="symbols">
374     <t>&SHOULD; send an entity tag validator unless it is not feasible to
375        generate one.</t>
377     <t>&MAY; send a weak entity tag instead of a strong entity tag, if
378        performance considerations support the use of weak entity tags,
379        or if it is unfeasible to send a strong entity tag.</t>
381     <t>&SHOULD; send a Last-Modified value if it is feasible to send one,
382        unless the risk of a breakdown in semantic transparency that
383        could result from using this date in an If-Modified-Since header
384        would lead to serious problems.</t>
385  </list>
388   In other words, the preferred behavior for an HTTP/1.1 origin server
389   is to send both a strong entity tag and a Last-Modified value.
392   In order to be legal, a strong entity tag &MUST; change whenever the
393   associated entity value changes in any way. A weak entity tag &SHOULD;
394   change whenever the associated entity changes in a semantically
395   significant way.
396  <list><t>
397      <x:h>Note:</x:h> in order to provide semantically transparent caching, an
398      origin server must avoid reusing a specific strong entity tag
399      value for two different entities, or reusing a specific weak
400      entity tag value for two semantically different entities. Cache
401      entries might persist for arbitrarily long periods, regardless of
402      expiration times, so it might be inappropriate to expect that a
403      cache will never again attempt to validate an entry using a
404      validator that it obtained at some point in the past.
405  </t></list>
408   HTTP/1.1 clients:
409  <list style="symbols">
410     <t>If an entity tag has been provided by the origin server, &MUST;
411        use that entity tag in any cache-conditional request (using If-Match
412        or If-None-Match).</t>
414     <t>If only a Last-Modified value has been provided by the origin
415        server, &SHOULD; use that value in non-subrange cache-conditional
416        requests (using If-Modified-Since).</t>
418     <t>If only a Last-Modified value has been provided by an HTTP/1.0
419        origin server, &MAY; use that value in subrange cache-conditional
420        requests (using If-Unmodified-Since:). The user agent &SHOULD;
421        provide a way to disable this, in case of difficulty.</t>
423     <t>If both an entity tag and a Last-Modified value have been
424        provided by the origin server, &SHOULD; use both validators in
425        cache-conditional requests. This allows both HTTP/1.0 and
426        HTTP/1.1 caches to respond appropriately.</t>
427  </list>
430   An HTTP/1.1 origin server, upon receiving a conditional request that
431   includes both a Last-Modified date (e.g., in an If-Modified-Since or
432   If-Unmodified-Since header field) and one or more entity tags (e.g.,
433   in an If-Match, If-None-Match, or If-Range header field) as cache
434   validators, &MUST-NOT; return a response status of 304 (Not Modified)
435   unless doing so is consistent with all of the conditional header
436   fields in the request.
439   An HTTP/1.1 caching proxy, upon receiving a conditional request that
440   includes both a Last-Modified date and one or more entity tags as
441   cache validators, &MUST-NOT; return a locally cached response to the
442   client unless that cached response is consistent with all of the
443   conditional header fields in the request.
444  <list><t>
445      <x:h>Note:</x:h> The general principle behind these rules is that HTTP/1.1
446      servers and clients should transmit as much non-redundant
447      information as is available in their responses and requests.
448      HTTP/1.1 systems receiving this information will make the most
449      conservative assumptions about the validators they receive.
450  </t><t>
451      HTTP/1.0 clients and caches will ignore entity tags. Generally,
452      last-modified values received or used by these systems will
453      support transparent and efficient caching, and so HTTP/1.1 origin
454      servers should provide Last-Modified values. In those rare cases
455      where the use of a Last-Modified value as a validator by an
456      HTTP/1.0 system could result in a serious problem, then HTTP/1.1
457      origin servers should not provide one.
458  </t></list>
462<section title="Header Field Definitions" anchor="header.fields">
464   This section defines the syntax and semantics of all standard
465   HTTP/1.1 header fields. For entity-header fields, both sender and
466   recipient refer to either the client or the server, depending on who
467   sends and who receives the entity.
470<section title="ETag" anchor="header.etag">
471  <iref primary="true" item="ETag header" x:for-anchor=""/>
472  <iref primary="true" item="Headers" subitem="ETag" x:for-anchor=""/>
474   The ETag response-header field provides the current value of the
475   entity tag for the requested variant. The headers used with entity
476   tags are described in sections <xref target="header.if-match" format="counter"/>, <xref target="header.if-none-match" format="counter"/> and &header-if-range;. The entity tag
477   &MAY; be used for comparison with other entities from the same resource
478   (see <xref target="weak.and.strong.validators"/>).
480<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="ETag"/>
481    ETag = "ETag" ":" entity-tag
484   Examples:
486<artwork type="example">
487   ETag: "xyzzy"
488   ETag: W/"xyzzy"
489   ETag: ""
493<section title="If-Match" anchor="header.if-match">
494  <iref primary="true" item="If-Match header" x:for-anchor=""/>
495  <iref primary="true" item="Headers" subitem="If-Match" x:for-anchor=""/>
497   The If-Match request-header field is used with a method to make it
498   conditional. A client that has one or more entities previously
499   obtained from the resource can verify that one of those entities is
500   current by including a list of their associated entity tags in the
501   If-Match header field. Entity tags are defined in <xref target="entity.tags"/>. The
502   purpose of this feature is to allow efficient updates of cached
503   information with a minimum amount of transaction overhead. It is also
504   used, on updating requests, to prevent inadvertent modification of
505   the wrong version of a resource. As a special case, the value "*"
506   matches any current entity of the resource.
508<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Match"/>
509    If-Match = "If-Match" ":" ( "*" | 1#entity-tag )
512   If any of the entity tags match the entity tag of the entity that
513   would have been returned in the response to a similar GET request
514   (without the If-Match header) on that resource, or if "*" is given
515   and any current entity exists for that resource, then the server &MAY;
516   perform the requested method as if the If-Match header field did not
517   exist.
520   A server &MUST; use the strong comparison function (see <xref target="weak.and.strong.validators"/>)
521   to compare the entity tags in If-Match.
524   If none of the entity tags match, or if "*" is given and no current
525   entity exists, the server &MUST-NOT; perform the requested method, and
526   &MUST; return a 412 (Precondition Failed) response. This behavior is
527   most useful when the client wants to prevent an updating method, such
528   as PUT, from modifying a resource that has changed since the client
529   last retrieved it.
532   If the request would, without the If-Match header field, result in
533   anything other than a 2xx or 412 status, then the If-Match header
534   &MUST; be ignored.
537   The meaning of "If-Match: *" is that the method &SHOULD; be performed
538   if the representation selected by the origin server (or by a cache,
539   possibly using the Vary mechanism, see &header-vary;) exists, and
540   &MUST-NOT; be performed if the representation does not exist.
543   A request intended to update a resource (e.g., a PUT) &MAY; include an
544   If-Match header field to signal that the request method &MUST-NOT; be
545   applied if the entity corresponding to the If-Match value (a single
546   entity tag) is no longer a representation of that resource. This
547   allows the user to indicate that they do not wish the request to be
548   successful if the resource has been changed without their knowledge.
549   Examples:
551<figure><artwork type="example">
552    If-Match: "xyzzy"
553    If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
554    If-Match: *
557   The result of a request having both an If-Match header field and
558   either an If-None-Match or an If-Modified-Since header fields is
559   undefined by this specification.
563<section title="If-Modified-Since" anchor="header.if-modified-since">
564  <iref primary="true" item="If-Modified-Since header" x:for-anchor=""/>
565  <iref primary="true" item="Headers" subitem="If-Modified-Since" x:for-anchor=""/>
567   The If-Modified-Since request-header field is used with a method to
568   make it conditional: if the requested variant has not been modified
569   since the time specified in this field, an entity will not be
570   returned from the server; instead, a 304 (not modified) response will
571   be returned without any message-body.
573<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Modified-Since"/>
574    If-Modified-Since = "If-Modified-Since" ":" HTTP-date
577   An example of the field is:
579<figure><artwork type="example">
580    If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
583   A GET method with an If-Modified-Since header and no Range header
584   requests that the identified entity be transferred only if it has
585   been modified since the date given by the If-Modified-Since header.
586   The algorithm for determining this includes the following cases:
587  <list style="numbers">
588      <t>If the request would normally result in anything other than a
589         200 (OK) status, or if the passed If-Modified-Since date is
590         invalid, the response is exactly the same as for a normal GET.
591         A date which is later than the server's current time is
592         invalid.</t>
594      <t>If the variant has been modified since the If-Modified-Since
595         date, the response is exactly the same as for a normal GET.</t>
597      <t>If the variant has not been modified since a valid If-Modified-Since
598         date, the server &SHOULD; return a 304 (Not
599         Modified) response.</t>
600  </list>
603   The purpose of this feature is to allow efficient updates of cached
604   information with a minimum amount of transaction overhead.
605  <list><t>
606      <x:h>Note:</x:h> The Range request-header field modifies the meaning of If-Modified-Since;
607      see &header-range; for full details.
608    </t><t>
609      <x:h>Note:</x:h> If-Modified-Since times are interpreted by the server, whose
610      clock might not be synchronized with the client.
611    </t><t>
612      <x:h>Note:</x:h> When handling an If-Modified-Since header field, some
613      servers will use an exact date comparison function, rather than a
614      less-than function, for deciding whether to send a 304 (Not
615      Modified) response. To get best results when sending an If-Modified-Since
616      header field for cache validation, clients are
617      advised to use the exact date string received in a previous Last-Modified
618      header field whenever possible.
619    </t><t>
620      <x:h>Note:</x:h> If a client uses an arbitrary date in the If-Modified-Since
621      header instead of a date taken from the Last-Modified header for
622      the same request, the client should be aware of the fact that this
623      date is interpreted in the server's understanding of time. The
624      client should consider unsynchronized clocks and rounding problems
625      due to the different encodings of time between the client and
626      server. This includes the possibility of race conditions if the
627      document has changed between the time it was first requested and
628      the If-Modified-Since date of a subsequent request, and the
629      possibility of clock-skew-related problems if the If-Modified-Since
630      date is derived from the client's clock without correction
631      to the server's clock. Corrections for different time bases
632      between client and server are at best approximate due to network
633      latency.
634    </t>
635  </list>
638   The result of a request having both an If-Modified-Since header field
639   and either an If-Match or an If-Unmodified-Since header fields is
640   undefined by this specification.
644<section title="If-None-Match" anchor="header.if-none-match">
645  <iref primary="true" item="If-None-Match header" x:for-anchor=""/>
646  <iref primary="true" item="Headers" subitem="If-None-Match" x:for-anchor=""/>
648   The If-None-Match request-header field is used with a method to make
649   it conditional. A client that has one or more entities previously
650   obtained from the resource can verify that none of those entities is
651   current by including a list of their associated entity tags in the
652   If-None-Match header field. The purpose of this feature is to allow
653   efficient updates of cached information with a minimum amount of
654   transaction overhead. It is also used to prevent a method (e.g. PUT)
655   from inadvertently modifying an existing resource when the client
656   believes that the resource does not exist.
659   As a special case, the value "*" matches any current entity of the
660   resource.
662<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-None-Match"/>
663    If-None-Match = "If-None-Match" ":" ( "*" | 1#entity-tag )
666   If any of the entity tags match the entity tag of the entity that
667   would have been returned in the response to a similar GET request
668   (without the If-None-Match header) on that resource, or if "*" is
669   given and any current entity exists for that resource, then the
670   server &MUST-NOT; perform the requested method, unless required to do
671   so because the resource's modification date fails to match that
672   supplied in an If-Modified-Since header field in the request.
673   Instead, if the request method was GET or HEAD, the server &SHOULD;
674   respond with a 304 (Not Modified) response, including the cache-related
675   header fields (particularly ETag) of one of the entities that
676   matched. For all other request methods, the server &MUST; respond with
677   a status of 412 (Precondition Failed).
680   See <xref target="weak.and.strong.validators"/> for rules on how to determine if two entities tags
681   match. The weak comparison function can only be used with GET or HEAD
682   requests.
685   If none of the entity tags match, then the server &MAY; perform the
686   requested method as if the If-None-Match header field did not exist,
687   but &MUST; also ignore any If-Modified-Since header field(s) in the
688   request. That is, if no entity tags match, then the server &MUST-NOT;
689   return a 304 (Not Modified) response.
692   If the request would, without the If-None-Match header field, result
693   in anything other than a 2xx or 304 status, then the If-None-Match
694   header &MUST; be ignored. (See <xref target=""/> for a discussion of
695   server behavior when both If-Modified-Since and If-None-Match appear
696   in the same request.)
699   The meaning of "If-None-Match: *" is that the method &MUST-NOT; be
700   performed if the representation selected by the origin server (or by
701   a cache, possibly using the Vary mechanism, see &header-vary;)
702   exists, and &SHOULD; be performed if the representation does not exist.
703   This feature is intended to be useful in preventing races between PUT
704   operations.
707   Examples:
709<figure><artwork type="example">
710    If-None-Match: "xyzzy"
711    If-None-Match: W/"xyzzy"
712    If-None-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
713    If-None-Match: W/"xyzzy", W/"r2d2xxxx", W/"c3piozzzz"
714    If-None-Match: *
717   The result of a request having both an If-None-Match header field and
718   either an If-Match or an If-Unmodified-Since header fields is
719   undefined by this specification.
723<section title="If-Unmodified-Since" anchor="header.if-unmodified-since">
724  <iref primary="true" item="If-Unmodified-Since header" x:for-anchor=""/>
725  <iref primary="true" item="Headers" subitem="If-Unmodified-Since" x:for-anchor=""/>
727   The If-Unmodified-Since request-header field is used with a method to
728   make it conditional. If the requested resource has not been modified
729   since the time specified in this field, the server &SHOULD; perform the
730   requested operation as if the If-Unmodified-Since header were not
731   present.
734   If the requested variant has been modified since the specified time,
735   the server &MUST-NOT; perform the requested operation, and &MUST; return
736   a 412 (Precondition Failed).
738<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Unmodified-Since"/>
739   If-Unmodified-Since = "If-Unmodified-Since" ":" HTTP-date
742   An example of the field is:
744<figure><artwork type="example">
745    If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT
748   If the request normally (i.e., without the If-Unmodified-Since
749   header) would result in anything other than a 2xx or 412 status, the
750   If-Unmodified-Since header &SHOULD; be ignored.
753   If the specified date is invalid, the header is ignored.
756   The result of a request having both an If-Unmodified-Since header
757   field and either an If-None-Match or an If-Modified-Since header
758   fields is undefined by this specification.
762<section title="Last-Modified" anchor="header.last-modified">
763  <iref primary="true" item="Last-Modified header" x:for-anchor=""/>
764  <iref primary="true" item="Headers" subitem="Last-Modified" x:for-anchor=""/>
766   The Last-Modified entity-header field indicates the date and time at
767   which the origin server believes the variant was last modified.
769<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Last-Modified"/>
770    Last-Modified  = "Last-Modified" ":" HTTP-date
773   An example of its use is
775<figure><artwork type="example">
776    Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT
779   The exact meaning of this header field depends on the implementation
780   of the origin server and the nature of the original resource. For
781   files, it may be just the file system last-modified time. For
782   entities with dynamically included parts, it may be the most recent
783   of the set of last-modify times for its component parts. For database
784   gateways, it may be the last-update time stamp of the record. For
785   virtual objects, it may be the last time the internal state changed.
788   An origin server &MUST-NOT; send a Last-Modified date which is later
789   than the server's time of message origination. In such cases, where
790   the resource's last modification would indicate some time in the
791   future, the server &MUST; replace that date with the message
792   origination date.
795   An origin server &SHOULD; obtain the Last-Modified value of the entity
796   as close as possible to the time that it generates the Date value of
797   its response. This allows a recipient to make an accurate assessment
798   of the entity's modification time, especially if the entity changes
799   near the time that the response is generated.
802   HTTP/1.1 servers &SHOULD; send Last-Modified whenever feasible.
808<section title="IANA Considerations" anchor="IANA.considerations">
810   TBD.
814<section title="Security Considerations" anchor="security.considerations">
816   No additional security considerations have been identified beyond
817   those applicable to HTTP in general &messaging;.
821<section title="Acknowledgments" anchor="ack">
823   Based on an XML translation of RFC 2616 by Julian Reschke.
830<reference anchor="Part1">
831   <front>
832      <title abbrev="HTTP/1.1">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</title>
833      <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
834         <organization abbrev="Day Software">Day Software</organization>
835         <address><email></email></address>
836      </author>
837      <author initials="J." surname="Gettys" fullname="Jim Gettys">
838         <organization>One Laptop per Child</organization>
839         <address><email></email></address>
840      </author>
841      <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
842         <organization abbrev="HP">Hewlett-Packard Company</organization>
843         <address><email></email></address>
844      </author>
845      <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
846         <organization abbrev="Microsoft">Microsoft Corporation</organization>
847         <address><email></email></address>
848      </author>
849      <author initials="L." surname="Masinter" fullname="Larry Masinter">
850         <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
851         <address><email></email></address>
852      </author>
853      <author initials="P." surname="Leach" fullname="Paul J. Leach">
854         <organization abbrev="Microsoft">Microsoft Corporation</organization>
855         <address><email></email></address>
856      </author>
857      <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
858         <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
859         <address><email></email></address>
860      </author>
861      <date month="&ID-MONTH;" year="&ID-YEAR;"/>
862   </front>
863   <seriesInfo name="Internet-Draft" value="draft-fielding-p1-messaging-&ID-VERSION;"/>
864   <x:source href="p1-messaging.xml" basename="p1-messaging"/>
867<reference anchor="Part5">
868   <front>
869      <title abbrev="HTTP/1.1">HTTP/1.1, part 5: Range Requests and Partial Responses</title>
870      <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
871         <organization abbrev="Day Software">Day Software</organization>
872         <address><email></email></address>
873      </author>
874      <author initials="J." surname="Gettys" fullname="Jim Gettys">
875         <organization>One Laptop per Child</organization>
876         <address><email></email></address>
877      </author>
878      <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
879         <organization abbrev="HP">Hewlett-Packard Company</organization>
880         <address><email></email></address>
881      </author>
882      <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
883         <organization abbrev="Microsoft">Microsoft Corporation</organization>
884         <address><email></email></address>
885      </author>
886      <author initials="L." surname="Masinter" fullname="Larry Masinter">
887         <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
888         <address><email></email></address>
889      </author>
890      <author initials="P." surname="Leach" fullname="Paul J. Leach">
891         <organization abbrev="Microsoft">Microsoft Corporation</organization>
892         <address><email></email></address>
893      </author>
894      <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
895         <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
896         <address><email></email></address>
897      </author>
898      <date month="&ID-MONTH;" year="&ID-YEAR;"/>
899   </front>
900   <seriesInfo name="Internet-Draft" value="draft-fielding-p5-range-&ID-VERSION;"/>
901   <x:source href="p5-range.xml" basename="p5-range"/>
904<reference anchor="Part6">
905   <front>
906      <title abbrev="HTTP/1.1">HTTP/1.1, part 6: Caching</title>
907      <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
908         <organization abbrev="Day Software">Day Software</organization>
909         <address><email></email></address>
910      </author>
911      <author initials="J." surname="Gettys" fullname="Jim Gettys">
912         <organization>One Laptop per Child</organization>
913         <address><email></email></address>
914      </author>
915      <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
916         <organization abbrev="HP">Hewlett-Packard Company</organization>
917         <address><email></email></address>
918      </author>
919      <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
920         <organization abbrev="Microsoft">Microsoft Corporation</organization>
921         <address><email></email></address>
922      </author>
923      <author initials="L." surname="Masinter" fullname="Larry Masinter">
924         <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
925         <address><email></email></address>
926      </author>
927      <author initials="P." surname="Leach" fullname="Paul J. Leach">
928         <organization abbrev="Microsoft">Microsoft Corporation</organization>
929         <address><email></email></address>
930      </author>
931      <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
932         <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
933         <address><email></email></address>
934      </author>
935      <date month="&ID-MONTH;" year="&ID-YEAR;"/>
936   </front>
937   <seriesInfo name="Internet-Draft" value="draft-fielding-p6-cache-&ID-VERSION;"/>
938   <x:source href="p6-cache.xml" basename="p6-cache"/>
941<reference anchor="RFC2616">
942   <front>
943      <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
944      <author initials="R." surname="Fielding" fullname="R. Fielding">
945         <organization>University of California, Irvine</organization>
946         <address><email></email></address>
947      </author>
948      <author initials="J." surname="Gettys" fullname="J. Gettys">
949         <organization>W3C</organization>
950         <address><email></email></address>
951      </author>
952      <author initials="J." surname="Mogul" fullname="J. Mogul">
953         <organization>Compaq Computer Corporation</organization>
954         <address><email></email></address>
955      </author>
956      <author initials="H." surname="Frystyk" fullname="H. Frystyk">
957         <organization>MIT Laboratory for Computer Science</organization>
958         <address><email></email></address>
959      </author>
960      <author initials="L." surname="Masinter" fullname="L. Masinter">
961         <organization>Xerox Corporation</organization>
962         <address><email></email></address>
963      </author>
964      <author initials="P." surname="Leach" fullname="P. Leach">
965         <organization>Microsoft Corporation</organization>
966         <address><email></email></address>
967      </author>
968      <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
969         <organization>W3C</organization>
970         <address><email></email></address>
971      </author>
972      <date month="June" year="1999"/>
973   </front>
974   <seriesInfo name="RFC" value="2616"/>
Note: See TracBrowser for help on using the repository browser.