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

Last change on this file since 98 was 97, checked in by julian.reschke@…, 15 years ago

Cleanup references after switch to symbolic references (removing duplicated RFC numbers), clean up some of the references XML code.

  • Property svn:eol-style set to native
File size: 50.8 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 caching                    "<xref target='Part6' xmlns:x=''/>">
18  <!ENTITY header-if-range            "<xref target='Part5' x:rel='#header.if-range' xmlns:x=''/>">
19  <!ENTITY header-range               "<xref target='Part5' x:rel='#header.range' xmlns:x=''/>">
20  <!ENTITY header-vary                "<xref target='Part6' x:rel='#header.vary' xmlns:x=''/>">
21  <!ENTITY clockless                  "<xref target='Part1' x:rel='#clockless.origin.server.operation' xmlns:x=''/>">
23<?rfc toc="yes" ?>
24<?rfc symrefs="yes" ?>
25<?rfc sortrefs="yes" ?>
26<?rfc compact="yes"?>
27<?rfc subcompact="no" ?>
28<?rfc linkmailto="no" ?>
29<?rfc editing="no" ?>
30<?rfc-ext allow-markup-in-artwork="yes" ?>
31<?rfc-ext include-references-in-index="yes" ?>
32<rfc obsoletes="2068, 2616" category="std"
33     ipr="full3978" docName="draft-ietf-httpbis-p4-conditional-&ID-VERSION;"
34     xmlns:x='' xmlns:ed="">
37  <title abbrev="HTTP/1.1, part 4">HTTP/1.1, part 4: Conditional Requests</title>
39  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
40    <organization abbrev="Day Software">Day Software</organization>
41    <address>
42      <postal>
43        <street>23 Corporate Plaza DR, Suite 280</street>
44        <city>Newport Beach</city>
45        <region>CA</region>
46        <code>92660</code>
47        <country>USA</country>
48      </postal>
49      <phone>+1-949-706-5300</phone>
50      <facsimile>+1-949-706-5305</facsimile>
51      <email></email>
52      <uri></uri>
53    </address>
54  </author>
56  <author initials="J." surname="Gettys" fullname="Jim Gettys">
57    <organization>One Laptop per Child</organization>
58    <address>
59      <postal>
60        <street>21 Oak Knoll Road</street>
61        <city>Carlisle</city>
62        <region>MA</region>
63        <code>01741</code>
64        <country>USA</country>
65      </postal>
66      <email></email>
67      <uri></uri>
68    </address>
69  </author>
71  <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
72    <organization abbrev="HP">Hewlett-Packard Company</organization>
73    <address>
74      <postal>
75        <street>HP Labs, Large Scale Systems Group</street>
76        <street>1501 Page Mill Road, MS 1177</street>
77        <city>Palo Alto</city>
78        <region>CA</region>
79        <code>94304</code>
80        <country>USA</country>
81      </postal>
82      <email></email>
83    </address>
84  </author>
86  <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
87    <organization abbrev="Microsoft">Microsoft Corporation</organization>
88    <address>
89      <postal>
90        <street>1 Microsoft Way</street>
91        <city>Redmond</city>
92        <region>WA</region>
93        <code>98052</code>
94        <country>USA</country>
95      </postal>
96      <email></email>
97    </address>
98  </author>
100  <author initials="L." surname="Masinter" fullname="Larry Masinter">
101    <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
102    <address>
103      <postal>
104        <street>345 Park Ave</street>
105        <city>San Jose</city>
106        <region>CA</region>
107        <code>95110</code>
108        <country>USA</country>
109      </postal>
110      <email></email>
111      <uri></uri>
112    </address>
113  </author>
115  <author initials="P." surname="Leach" fullname="Paul J. Leach">
116    <organization abbrev="Microsoft">Microsoft Corporation</organization>
117    <address>
118      <postal>
119        <street>1 Microsoft Way</street>
120        <city>Redmond</city>
121        <region>WA</region>
122        <code>98052</code>
123      </postal>
124      <email></email>
125    </address>
126  </author>
128  <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
129    <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
130    <address>
131      <postal>
132        <street>MIT Computer Science and Artificial Intelligence Laboratory</street>
133        <street>The Stata Center, Building 32</street>
134        <street>32 Vassar Street</street>
135        <city>Cambridge</city>
136        <region>MA</region>
137        <code>02139</code>
138        <country>USA</country>
139      </postal>
140      <email></email>
141      <uri></uri>
142    </address>
143  </author>
145  <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
146    <organization abbrev="W3C">World Wide Web Consortium</organization>
147    <address>
148      <postal>
149        <street>W3C / ERCIM</street>
150        <street>2004, rte des Lucioles</street>
151        <city>Sophia-Antipolis</city>
152        <region>AM</region>
153        <code>06902</code>
154        <country>France</country>
155      </postal>
156      <email></email>
157      <uri></uri>
158    </address>
159  </author>
161  <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
162    <organization abbrev="greenbytes">greenbytes GmbH</organization>
163    <address>
164      <postal>
165        <street>Hafenweg 16</street>
166        <city>Muenster</city><region>NW</region><code>48155</code>
167        <country>Germany</country>
168      </postal>
169      <phone>+49 251 2807760</phone>   
170      <facsimile>+49 251 2807761</facsimile>   
171      <email></email>       
172      <uri></uri>     
173    </address>
174  </author>
176  <date month="&ID-MONTH;" year="&ID-YEAR;"/>
180   The Hypertext Transfer Protocol (HTTP) is an application-level
181   protocol for distributed, collaborative, hypermedia information
182   systems. HTTP has been in use by the World Wide Web global information
183   initiative since 1990. This document is Part 4 of the seven-part specification
184   that defines the protocol referred to as "HTTP/1.1" and, taken together,
185   obsoletes RFC 2616.  Part 4 defines request header fields for
186   indicating conditional requests and the rules for constructing responses
187   to those requests.
191<note title="Editorial Note (To be removed by RFC Editor)">
192  <t>
193    This version of the HTTP specification contains only minimal editorial
194    changes from <xref target="RFC2616"/> (abstract, introductory paragraph,
195    and authors' addresses).  All other changes are due to partitioning the
196    original into seven mostly independent parts.  The intent is for readers
197    of future drafts to able to use draft 00 as the basis for comparison
198    when the WG makes later changes to the specification text.  This draft
199    will shortly be followed by draft 01 (containing the first round of changes
200    that have already been agreed to on the mailing list). There is no point in
201    reviewing this draft other than to verify that the partitioning has been
202    done correctly.  Roy T. Fielding, Yves Lafon, and Julian Reschke
203    will be the editors after draft 00 is submitted.
204  </t>
205  <t>
206    Discussion of this draft should take place on the HTTPBIS working group
207    mailing list ( The current issues list is
208    at <eref target=""/>
209    and related documents (including fancy diffs) can be found at
210    <eref target=""/>.
211  </t>
215<section title="Introduction" anchor="introduction">
217   This document will define aspects of HTTP related to conditional
218   request messages based on time stamps and entity-tags.  Right now it
219   only includes the extracted relevant sections of <xref target="RFC2616">RFC 2616</xref>
220   without edit.
223<section title="Requirements" anchor="intro.requirements">
225   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
226   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
227   document are to be interpreted as described in <xref target="RFC2119"/>.
230   An implementation is not compliant if it fails to satisfy one or more
231   of the &MUST; or &REQUIRED; level requirements for the protocols it
232   implements. An implementation that satisfies all the &MUST; or &REQUIRED;
233   level and all the &SHOULD; level requirements for its protocols is said
234   to be "unconditionally compliant"; one that satisfies all the &MUST;
235   level requirements but not all the &SHOULD; level requirements for its
236   protocols is said to be "conditionally compliant."
241<section title="Entity Tags" anchor="entity.tags">
243   Entity tags are used for comparing two or more entities from the same
244   requested resource. HTTP/1.1 uses entity tags in the ETag (<xref target="header.etag"/>),
245   If-Match (<xref target="header.if-match"/>), If-None-Match (<xref target="header.if-none-match"/>), and
246   If-Range (&header-if-range;) header fields. The definition of how they
247   are used and compared as cache validators is in <xref target="weak.and.strong.validators"/>. An
248   entity tag consists of an opaque quoted string, possibly prefixed by
249   a weakness indicator.
251<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"/>
252   entity-tag = [ weak ] opaque-tag
253   weak       = "W/"
254   opaque-tag = quoted-string
257   A "strong entity tag" &MAY; be shared by two entities of a resource
258   only if they are equivalent by octet equality.
261   A "weak entity tag," indicated by the "W/" prefix, &MAY; be shared by
262   two entities of a resource only if the entities are equivalent and
263   could be substituted for each other with no significant change in
264   semantics. A weak entity tag can only be used for weak comparison.
267   An entity tag &MUST; be unique across all versions of all entities
268   associated with a particular resource. A given entity tag value &MAY;
269   be used for entities obtained by requests on different URIs. The use
270   of the same entity tag value in conjunction with entities obtained by
271   requests on different URIs does not imply the equivalence of those
272   entities.
276<section title="Status Code Definitions">
277<section title="304 Not Modified" anchor="status.304">
278  <iref primary="true" item="304 Not Modified (status code)" x:for-anchor=""/>
279  <iref primary="true" item="Status Codes" subitem="304 Not Modified" x:for-anchor=""/>
281   If the client has performed a conditional GET request and access is
282   allowed, but the document has not been modified, the server &SHOULD;
283   respond with this status code. The 304 response &MUST-NOT; contain a
284   message-body, and thus is always terminated by the first empty line
285   after the header fields.
288   The response &MUST; include the following header fields:
289  <list style="symbols">
290    <t>Date, unless its omission is required by &clockless;</t>
291  </list>
294   If a clockless origin server obeys these rules, and proxies and
295   clients add their own Date to any response received without one (as
296   already specified by <xref target="RFC2068" x:sec="14.19" x:fmt=","/>), caches will operate
297   correctly.
298  <list style="symbols">
299    <t>ETag and/or Content-Location, if the header would have been sent
300        in a 200 response to the same request</t>
301    <t>Expires, Cache-Control, and/or Vary, if the field-value might
302        differ from that sent in any previous response for the same
303        variant</t>
304  </list>
307   If the conditional GET used a strong cache validator (see &caching;),
308   the response &SHOULD-NOT;  include other entity-headers.
309   Otherwise (i.e., the conditional GET used a weak validator), the
310   response &MUST-NOT; include other entity-headers; this prevents
311   inconsistencies between cached entity-bodies and updated headers.
314   If a 304 response indicates an entity not currently cached, then the
315   cache &MUST; disregard the response and repeat the request without the
316   conditional.
319   If a cache uses a received 304 response to update a cache entry, the
320   cache &MUST; update the entry to reflect any new field values given in
321   the response.
325<section title="412 Precondition Failed" anchor="status.412">
326  <iref primary="true" item="412 Precondition Failed (status code)" x:for-anchor=""/>
327  <iref primary="true" item="Status Codes" subitem="412 Precondition Failed" x:for-anchor=""/>
329   The precondition given in one or more of the request-header fields
330   evaluated to false when it was tested on the server. This response
331   code allows the client to place preconditions on the current resource
332   metainformation (header field data) and thus prevent the requested
333   method from being applied to a resource other than the one intended.
338<section title="Weak and Strong Validators" anchor="weak.and.strong.validators">
340   Since both origin servers and caches will compare two validators to
341   decide if they represent the same or different entities, one normally
342   would expect that if the entity (the entity-body or any entity-headers)
343   changes in any way, then the associated validator would
344   change as well. If this is true, then we call this validator a
345   "strong validator."
348   However, there might be cases when a server prefers to change the
349   validator only on semantically significant changes, and not when
350   insignificant aspects of the entity change. A validator that does not
351   always change when the resource changes is a "weak validator."
354   Entity tags are normally "strong validators," but the protocol
355   provides a mechanism to tag an entity tag as "weak." One can think of
356   a strong validator as one that changes whenever the bits of an entity
357   changes, while a weak value changes whenever the meaning of an entity
358   changes. Alternatively, one can think of a strong validator as part
359   of an identifier for a specific entity, while a weak validator is
360   part of an identifier for a set of semantically equivalent entities.
361  <list><t>
362      <x:h>Note:</x:h> One example of a strong validator is an integer that is
363      incremented in stable storage every time an entity is changed.
364    </t><t>
365      An entity's modification time, if represented with one-second
366      resolution, could be a weak validator, since it is possible that
367      the resource might be modified twice during a single second.
368    </t><t>
369      Support for weak validators is optional. However, weak validators
370      allow for more efficient caching of equivalent objects; for
371      example, a hit counter on a site is probably good enough if it is
372      updated every few days or weeks, and any value during that period
373      is likely "good enough" to be equivalent.
374    </t></list>
377   A "use" of a validator is either when a client generates a request
378   and includes the validator in a validating header field, or when a
379   server compares two validators.
382   Strong validators are usable in any context. Weak validators are only
383   usable in contexts that do not depend on exact equality of an entity.
384   For example, either kind is usable for a conditional GET of a full
385   entity. However, only a strong validator is usable for a sub-range
386   retrieval, since otherwise the client might end up with an internally
387   inconsistent entity.
390   Clients &MAY; issue simple (non-subrange) GET requests with either weak
391   validators or strong validators. Clients &MUST-NOT; use weak validators
392   in other forms of request.
395   The only function that the HTTP/1.1 protocol defines on validators is
396   comparison. There are two validator comparison functions, depending
397   on whether the comparison context allows the use of weak validators
398   or not:
399  <list style="symbols">
400     <t>The strong comparison function: in order to be considered equal,
401        both validators &MUST; be identical in every way, and both &MUST-NOT;
402        be weak.</t>
403     <t>The weak comparison function: in order to be considered equal,
404        both validators &MUST; be identical in every way, but either or
405        both of them &MAY; be tagged as "weak" without affecting the
406        result.</t>
407  </list>
410   An entity tag is strong unless it is explicitly tagged as weak.
411   <xref target="entity.tags"/> gives the syntax for entity tags.
414   A Last-Modified time, when used as a validator in a request, is
415   implicitly weak unless it is possible to deduce that it is strong,
416   using the following rules:
417  <list style="symbols">
418     <t>The validator is being compared by an origin server to the
419        actual current validator for the entity and,</t>
420     <t>That origin server reliably knows that the associated entity did
421        not change twice during the second covered by the presented
422        validator.</t>
423  </list>
426   or
427  <list style="symbols">
428     <t>The validator is about to be used by a client in an If-Modified-Since
429        or If-Unmodified-Since header, because the client
430        has a cache entry for the associated entity, and</t>
431     <t>That cache entry includes a Date value, which gives the time
432        when the origin server sent the original response, and</t>
433     <t>The presented Last-Modified time is at least 60 seconds before
434        the Date value.</t>
435  </list>
438   or
439  <list style="symbols">
440     <t>The validator is being compared by an intermediate cache to the
441        validator stored in its cache entry for the entity, and</t>
442     <t>That cache entry includes a Date value, which gives the time
443        when the origin server sent the original response, and</t>
444     <t>The presented Last-Modified time is at least 60 seconds before
445        the Date value.</t>
446  </list>
449   This method relies on the fact that if two different responses were
450   sent by the origin server during the same second, but both had the
451   same Last-Modified time, then at least one of those responses would
452   have a Date value equal to its Last-Modified time. The arbitrary 60-second
453   limit guards against the possibility that the Date and Last-Modified
454   values are generated from different clocks, or at somewhat
455   different times during the preparation of the response. An
456   implementation &MAY; use a value larger than 60 seconds, if it is
457   believed that 60 seconds is too short.
460   If a client wishes to perform a sub-range retrieval on a value for
461   which it has only a Last-Modified time and no opaque validator, it
462   &MAY; do this only if the Last-Modified time is strong in the sense
463   described here.
466   A cache or origin server receiving a conditional request, other than
467   a full-body GET request, &MUST; use the strong comparison function to
468   evaluate the condition.
471   These rules allow HTTP/1.1 caches and clients to safely perform sub-range
472   retrievals on values that have been obtained from HTTP/1.0
473   servers.
477<section title="Rules for When to Use Entity Tags and Last-Modified Dates" anchor="">
479   We adopt a set of rules and recommendations for origin servers,
480   clients, and caches regarding when various validator types ought to
481   be used, and for what purposes.
484   HTTP/1.1 origin servers:
485  <list style="symbols">
486     <t>&SHOULD; send an entity tag validator unless it is not feasible to
487        generate one.</t>
489     <t>&MAY; send a weak entity tag instead of a strong entity tag, if
490        performance considerations support the use of weak entity tags,
491        or if it is unfeasible to send a strong entity tag.</t>
493     <t>&SHOULD; send a Last-Modified value if it is feasible to send one,
494        unless the risk of a breakdown in semantic transparency that
495        could result from using this date in an If-Modified-Since header
496        would lead to serious problems.</t>
497  </list>
500   In other words, the preferred behavior for an HTTP/1.1 origin server
501   is to send both a strong entity tag and a Last-Modified value.
504   In order to be legal, a strong entity tag &MUST; change whenever the
505   associated entity value changes in any way. A weak entity tag &SHOULD;
506   change whenever the associated entity changes in a semantically
507   significant way.
508  <list><t>
509      <x:h>Note:</x:h> in order to provide semantically transparent caching, an
510      origin server must avoid reusing a specific strong entity tag
511      value for two different entities, or reusing a specific weak
512      entity tag value for two semantically different entities. Cache
513      entries might persist for arbitrarily long periods, regardless of
514      expiration times, so it might be inappropriate to expect that a
515      cache will never again attempt to validate an entry using a
516      validator that it obtained at some point in the past.
517  </t></list>
520   HTTP/1.1 clients:
521  <list style="symbols">
522     <t>If an entity tag has been provided by the origin server, &MUST;
523        use that entity tag in any cache-conditional request (using If-Match
524        or If-None-Match).</t>
526     <t>If only a Last-Modified value has been provided by the origin
527        server, &SHOULD; use that value in non-subrange cache-conditional
528        requests (using If-Modified-Since).</t>
530     <t>If only a Last-Modified value has been provided by an HTTP/1.0
531        origin server, &MAY; use that value in subrange cache-conditional
532        requests (using If-Unmodified-Since:). The user agent &SHOULD;
533        provide a way to disable this, in case of difficulty.</t>
535     <t>If both an entity tag and a Last-Modified value have been
536        provided by the origin server, &SHOULD; use both validators in
537        cache-conditional requests. This allows both HTTP/1.0 and
538        HTTP/1.1 caches to respond appropriately.</t>
539  </list>
542   An HTTP/1.1 origin server, upon receiving a conditional request that
543   includes both a Last-Modified date (e.g., in an If-Modified-Since or
544   If-Unmodified-Since header field) and one or more entity tags (e.g.,
545   in an If-Match, If-None-Match, or If-Range header field) as cache
546   validators, &MUST-NOT; return a response status of 304 (Not Modified)
547   unless doing so is consistent with all of the conditional header
548   fields in the request.
551   An HTTP/1.1 caching proxy, upon receiving a conditional request that
552   includes both a Last-Modified date and one or more entity tags as
553   cache validators, &MUST-NOT; return a locally cached response to the
554   client unless that cached response is consistent with all of the
555   conditional header fields in the request.
556  <list><t>
557      <x:h>Note:</x:h> The general principle behind these rules is that HTTP/1.1
558      servers and clients should transmit as much non-redundant
559      information as is available in their responses and requests.
560      HTTP/1.1 systems receiving this information will make the most
561      conservative assumptions about the validators they receive.
562  </t><t>
563      HTTP/1.0 clients and caches will ignore entity tags. Generally,
564      last-modified values received or used by these systems will
565      support transparent and efficient caching, and so HTTP/1.1 origin
566      servers should provide Last-Modified values. In those rare cases
567      where the use of a Last-Modified value as a validator by an
568      HTTP/1.0 system could result in a serious problem, then HTTP/1.1
569      origin servers should not provide one.
570  </t></list>
574<section title="Header Field Definitions" anchor="header.fields">
576   This section defines the syntax and semantics of all standard
577   HTTP/1.1 header fields. For entity-header fields, both sender and
578   recipient refer to either the client or the server, depending on who
579   sends and who receives the entity.
582<section title="ETag" anchor="header.etag">
583  <iref primary="true" item="ETag header" x:for-anchor=""/>
584  <iref primary="true" item="Headers" subitem="ETag" x:for-anchor=""/>
586   The ETag response-header field provides the current value of the
587   entity tag for the requested variant. The headers used with entity
588   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
589   &MAY; be used for comparison with other entities from the same resource
590   (see <xref target="weak.and.strong.validators"/>).
592<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="ETag"/>
593    ETag = "ETag" ":" entity-tag
596   Examples:
598<artwork type="example">
599   ETag: "xyzzy"
600   ETag: W/"xyzzy"
601   ETag: ""
605<section title="If-Match" anchor="header.if-match">
606  <iref primary="true" item="If-Match header" x:for-anchor=""/>
607  <iref primary="true" item="Headers" subitem="If-Match" x:for-anchor=""/>
609   The If-Match request-header field is used with a method to make it
610   conditional. A client that has one or more entities previously
611   obtained from the resource can verify that one of those entities is
612   current by including a list of their associated entity tags in the
613   If-Match header field. Entity tags are defined in <xref target="entity.tags"/>. The
614   purpose of this feature is to allow efficient updates of cached
615   information with a minimum amount of transaction overhead. It is also
616   used, on updating requests, to prevent inadvertent modification of
617   the wrong version of a resource. As a special case, the value "*"
618   matches any current entity of the resource.
620<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Match"/>
621    If-Match = "If-Match" ":" ( "*" | 1#entity-tag )
624   If any of the entity tags match the entity tag of the entity that
625   would have been returned in the response to a similar GET request
626   (without the If-Match header) on that resource, or if "*" is given
627   and any current entity exists for that resource, then the server &MAY;
628   perform the requested method as if the If-Match header field did not
629   exist.
632   A server &MUST; use the strong comparison function (see <xref target="weak.and.strong.validators"/>)
633   to compare the entity tags in If-Match.
636   If none of the entity tags match, or if "*" is given and no current
637   entity exists, the server &MUST-NOT; perform the requested method, and
638   &MUST; return a 412 (Precondition Failed) response. This behavior is
639   most useful when the client wants to prevent an updating method, such
640   as PUT, from modifying a resource that has changed since the client
641   last retrieved it.
644   If the request would, without the If-Match header field, result in
645   anything other than a 2xx or 412 status, then the If-Match header
646   &MUST; be ignored.
649   The meaning of "If-Match: *" is that the method &SHOULD; be performed
650   if the representation selected by the origin server (or by a cache,
651   possibly using the Vary mechanism, see &header-vary;) exists, and
652   &MUST-NOT; be performed if the representation does not exist.
655   A request intended to update a resource (e.g., a PUT) &MAY; include an
656   If-Match header field to signal that the request method &MUST-NOT; be
657   applied if the entity corresponding to the If-Match value (a single
658   entity tag) is no longer a representation of that resource. This
659   allows the user to indicate that they do not wish the request to be
660   successful if the resource has been changed without their knowledge.
661   Examples:
663<figure><artwork type="example">
664    If-Match: "xyzzy"
665    If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
666    If-Match: *
669   The result of a request having both an If-Match header field and
670   either an If-None-Match or an If-Modified-Since header fields is
671   undefined by this specification.
675<section title="If-Modified-Since" anchor="header.if-modified-since">
676  <iref primary="true" item="If-Modified-Since header" x:for-anchor=""/>
677  <iref primary="true" item="Headers" subitem="If-Modified-Since" x:for-anchor=""/>
679   The If-Modified-Since request-header field is used with a method to
680   make it conditional: if the requested variant has not been modified
681   since the time specified in this field, an entity will not be
682   returned from the server; instead, a 304 (not modified) response will
683   be returned without any message-body.
685<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Modified-Since"/>
686    If-Modified-Since = "If-Modified-Since" ":" HTTP-date
689   An example of the field is:
691<figure><artwork type="example">
692    If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
695   A GET method with an If-Modified-Since header and no Range header
696   requests that the identified entity be transferred only if it has
697   been modified since the date given by the If-Modified-Since header.
698   The algorithm for determining this includes the following cases:
699  <list style="numbers">
700      <t>If the request would normally result in anything other than a
701         200 (OK) status, or if the passed If-Modified-Since date is
702         invalid, the response is exactly the same as for a normal GET.
703         A date which is later than the server's current time is
704         invalid.</t>
706      <t>If the variant has been modified since the If-Modified-Since
707         date, the response is exactly the same as for a normal GET.</t>
709      <t>If the variant has not been modified since a valid If-Modified-Since
710         date, the server &SHOULD; return a 304 (Not
711         Modified) response.</t>
712  </list>
715   The purpose of this feature is to allow efficient updates of cached
716   information with a minimum amount of transaction overhead.
717  <list><t>
718      <x:h>Note:</x:h> The Range request-header field modifies the meaning of If-Modified-Since;
719      see &header-range; for full details.
720    </t><t>
721      <x:h>Note:</x:h> If-Modified-Since times are interpreted by the server, whose
722      clock might not be synchronized with the client.
723    </t><t>
724      <x:h>Note:</x:h> When handling an If-Modified-Since header field, some
725      servers will use an exact date comparison function, rather than a
726      less-than function, for deciding whether to send a 304 (Not
727      Modified) response. To get best results when sending an If-Modified-Since
728      header field for cache validation, clients are
729      advised to use the exact date string received in a previous Last-Modified
730      header field whenever possible.
731    </t><t>
732      <x:h>Note:</x:h> If a client uses an arbitrary date in the If-Modified-Since
733      header instead of a date taken from the Last-Modified header for
734      the same request, the client should be aware of the fact that this
735      date is interpreted in the server's understanding of time. The
736      client should consider unsynchronized clocks and rounding problems
737      due to the different encodings of time between the client and
738      server. This includes the possibility of race conditions if the
739      document has changed between the time it was first requested and
740      the If-Modified-Since date of a subsequent request, and the
741      possibility of clock-skew-related problems if the If-Modified-Since
742      date is derived from the client's clock without correction
743      to the server's clock. Corrections for different time bases
744      between client and server are at best approximate due to network
745      latency.
746    </t>
747  </list>
750   The result of a request having both an If-Modified-Since header field
751   and either an If-Match or an If-Unmodified-Since header fields is
752   undefined by this specification.
756<section title="If-None-Match" anchor="header.if-none-match">
757  <iref primary="true" item="If-None-Match header" x:for-anchor=""/>
758  <iref primary="true" item="Headers" subitem="If-None-Match" x:for-anchor=""/>
760   The If-None-Match request-header field is used with a method to make
761   it conditional. A client that has one or more entities previously
762   obtained from the resource can verify that none of those entities is
763   current by including a list of their associated entity tags in the
764   If-None-Match header field. The purpose of this feature is to allow
765   efficient updates of cached information with a minimum amount of
766   transaction overhead. It is also used to prevent a method (e.g. PUT)
767   from inadvertently modifying an existing resource when the client
768   believes that the resource does not exist.
771   As a special case, the value "*" matches any current entity of the
772   resource.
774<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-None-Match"/>
775    If-None-Match = "If-None-Match" ":" ( "*" | 1#entity-tag )
778   If any of the entity tags match the entity tag of the entity that
779   would have been returned in the response to a similar GET request
780   (without the If-None-Match header) on that resource, or if "*" is
781   given and any current entity exists for that resource, then the
782   server &MUST-NOT; perform the requested method, unless required to do
783   so because the resource's modification date fails to match that
784   supplied in an If-Modified-Since header field in the request.
785   Instead, if the request method was GET or HEAD, the server &SHOULD;
786   respond with a 304 (Not Modified) response, including the cache-related
787   header fields (particularly ETag) of one of the entities that
788   matched. For all other request methods, the server &MUST; respond with
789   a status of 412 (Precondition Failed).
792   See <xref target="weak.and.strong.validators"/> for rules on how to determine if two entities tags
793   match. The weak comparison function can only be used with GET or HEAD
794   requests.
797   If none of the entity tags match, then the server &MAY; perform the
798   requested method as if the If-None-Match header field did not exist,
799   but &MUST; also ignore any If-Modified-Since header field(s) in the
800   request. That is, if no entity tags match, then the server &MUST-NOT;
801   return a 304 (Not Modified) response.
804   If the request would, without the If-None-Match header field, result
805   in anything other than a 2xx or 304 status, then the If-None-Match
806   header &MUST; be ignored. (See <xref target=""/> for a discussion of
807   server behavior when both If-Modified-Since and If-None-Match appear
808   in the same request.)
811   The meaning of "If-None-Match: *" is that the method &MUST-NOT; be
812   performed if the representation selected by the origin server (or by
813   a cache, possibly using the Vary mechanism, see &header-vary;)
814   exists, and &SHOULD; be performed if the representation does not exist.
815   This feature is intended to be useful in preventing races between PUT
816   operations.
819   Examples:
821<figure><artwork type="example">
822    If-None-Match: "xyzzy"
823    If-None-Match: W/"xyzzy"
824    If-None-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
825    If-None-Match: W/"xyzzy", W/"r2d2xxxx", W/"c3piozzzz"
826    If-None-Match: *
829   The result of a request having both an If-None-Match header field and
830   either an If-Match or an If-Unmodified-Since header fields is
831   undefined by this specification.
835<section title="If-Unmodified-Since" anchor="header.if-unmodified-since">
836  <iref primary="true" item="If-Unmodified-Since header" x:for-anchor=""/>
837  <iref primary="true" item="Headers" subitem="If-Unmodified-Since" x:for-anchor=""/>
839   The If-Unmodified-Since request-header field is used with a method to
840   make it conditional. If the requested resource has not been modified
841   since the time specified in this field, the server &SHOULD; perform the
842   requested operation as if the If-Unmodified-Since header were not
843   present.
846   If the requested variant has been modified since the specified time,
847   the server &MUST-NOT; perform the requested operation, and &MUST; return
848   a 412 (Precondition Failed).
850<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Unmodified-Since"/>
851   If-Unmodified-Since = "If-Unmodified-Since" ":" HTTP-date
854   An example of the field is:
856<figure><artwork type="example">
857    If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT
860   If the request normally (i.e., without the If-Unmodified-Since
861   header) would result in anything other than a 2xx or 412 status, the
862   If-Unmodified-Since header &SHOULD; be ignored.
865   If the specified date is invalid, the header is ignored.
868   The result of a request having both an If-Unmodified-Since header
869   field and either an If-None-Match or an If-Modified-Since header
870   fields is undefined by this specification.
874<section title="Last-Modified" anchor="header.last-modified">
875  <iref primary="true" item="Last-Modified header" x:for-anchor=""/>
876  <iref primary="true" item="Headers" subitem="Last-Modified" x:for-anchor=""/>
878   The Last-Modified entity-header field indicates the date and time at
879   which the origin server believes the variant was last modified.
881<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Last-Modified"/>
882    Last-Modified  = "Last-Modified" ":" HTTP-date
885   An example of its use is
887<figure><artwork type="example">
888    Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT
891   The exact meaning of this header field depends on the implementation
892   of the origin server and the nature of the original resource. For
893   files, it may be just the file system last-modified time. For
894   entities with dynamically included parts, it may be the most recent
895   of the set of last-modify times for its component parts. For database
896   gateways, it may be the last-update time stamp of the record. For
897   virtual objects, it may be the last time the internal state changed.
900   An origin server &MUST-NOT; send a Last-Modified date which is later
901   than the server's time of message origination. In such cases, where
902   the resource's last modification would indicate some time in the
903   future, the server &MUST; replace that date with the message
904   origination date.
907   An origin server &SHOULD; obtain the Last-Modified value of the entity
908   as close as possible to the time that it generates the Date value of
909   its response. This allows a recipient to make an accurate assessment
910   of the entity's modification time, especially if the entity changes
911   near the time that the response is generated.
914   HTTP/1.1 servers &SHOULD; send Last-Modified whenever feasible.
920<section title="IANA Considerations" anchor="IANA.considerations">
922   TBD.
926<section title="Security Considerations" anchor="security.considerations">
928   No additional security considerations have been identified beyond
929   those applicable to HTTP in general &messaging;.
933<section title="Acknowledgments" anchor="ack">
939<reference anchor="Part1">
940   <front>
941      <title abbrev="HTTP/1.1">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</title>
942      <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
943         <organization abbrev="Day Software">Day Software</organization>
944         <address><email></email></address>
945      </author>
946      <author initials="J." surname="Gettys" fullname="Jim Gettys">
947         <organization>One Laptop per Child</organization>
948         <address><email></email></address>
949      </author>
950      <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
951         <organization abbrev="HP">Hewlett-Packard Company</organization>
952         <address><email></email></address>
953      </author>
954      <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
955         <organization abbrev="Microsoft">Microsoft Corporation</organization>
956         <address><email></email></address>
957      </author>
958      <author initials="L." surname="Masinter" fullname="Larry Masinter">
959         <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
960         <address><email></email></address>
961      </author>
962      <author initials="P." surname="Leach" fullname="Paul J. Leach">
963         <organization abbrev="Microsoft">Microsoft Corporation</organization>
964         <address><email></email></address>
965      </author>
966      <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
967         <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
968         <address><email></email></address>
969      </author>
970      <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
971         <organization abbrev="W3C">World Wide Web Consortium</organization>
972         <address><email></email></address>
973      </author>
974      <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
975         <organization abbrev="greenbytes">greenbytes GmbH</organization>
976         <address><email></email></address>
977      </author>
978      <date month="&ID-MONTH;" year="&ID-YEAR;"/>
979   </front>
980   <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"/>
981   <x:source href="p1-messaging.xml" basename="p1-messaging"/>
984<reference anchor="Part5">
985   <front>
986      <title abbrev="HTTP/1.1">HTTP/1.1, part 5: Range Requests and Partial Responses</title>
987      <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
988         <organization abbrev="Day Software">Day Software</organization>
989         <address><email></email></address>
990      </author>
991      <author initials="J." surname="Gettys" fullname="Jim Gettys">
992         <organization>One Laptop per Child</organization>
993         <address><email></email></address>
994      </author>
995      <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
996         <organization abbrev="HP">Hewlett-Packard Company</organization>
997         <address><email></email></address>
998      </author>
999      <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1000         <organization abbrev="Microsoft">Microsoft Corporation</organization>
1001         <address><email></email></address>
1002      </author>
1003      <author initials="L." surname="Masinter" fullname="Larry Masinter">
1004         <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1005         <address><email></email></address>
1006      </author>
1007      <author initials="P." surname="Leach" fullname="Paul J. Leach">
1008         <organization abbrev="Microsoft">Microsoft Corporation</organization>
1009         <address><email></email></address>
1010      </author>
1011      <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1012         <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1013         <address><email></email></address>
1014      </author>
1015      <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1016         <organization abbrev="W3C">World Wide Web Consortium</organization>
1017         <address><email></email></address>
1018      </author>
1019      <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1020         <organization abbrev="greenbytes">greenbytes GmbH</organization>
1021         <address><email></email></address>
1022      </author>
1023      <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1024   </front>
1025   <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p5-range-&ID-VERSION;"/>
1026   <x:source href="p5-range.xml" basename="p5-range"/>
1029<reference anchor="Part6">
1030   <front>
1031      <title abbrev="HTTP/1.1">HTTP/1.1, part 6: Caching</title>
1032      <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1033         <organization abbrev="Day Software">Day Software</organization>
1034         <address><email></email></address>
1035      </author>
1036      <author initials="J." surname="Gettys" fullname="Jim Gettys">
1037         <organization>One Laptop per Child</organization>
1038         <address><email></email></address>
1039      </author>
1040      <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1041         <organization abbrev="HP">Hewlett-Packard Company</organization>
1042         <address><email></email></address>
1043      </author>
1044      <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1045         <organization abbrev="Microsoft">Microsoft Corporation</organization>
1046         <address><email></email></address>
1047      </author>
1048      <author initials="L." surname="Masinter" fullname="Larry Masinter">
1049         <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1050         <address><email></email></address>
1051      </author>
1052      <author initials="P." surname="Leach" fullname="Paul J. Leach">
1053         <organization abbrev="Microsoft">Microsoft Corporation</organization>
1054         <address><email></email></address>
1055      </author>
1056      <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1057         <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1058         <address><email></email></address>
1059      </author>
1060      <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1061         <organization abbrev="W3C">World Wide Web Consortium</organization>
1062         <address><email></email></address>
1063      </author>
1064      <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1065         <organization abbrev="greenbytes">greenbytes GmbH</organization>
1066         <address><email></email></address>
1067      </author>
1068      <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1069   </front>
1070   <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-&ID-VERSION;"/>
1071   <x:source href="p6-cache.xml" basename="p6-cache"/>
1074<reference anchor="RFC2616">
1075   <front>
1076      <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
1077      <author initials="R." surname="Fielding" fullname="R. Fielding">
1078         <organization>University of California, Irvine</organization>
1079         <address><email></email></address>
1080      </author>
1081      <author initials="J." surname="Gettys" fullname="J. Gettys">
1082         <organization>W3C</organization>
1083         <address><email></email></address>
1084      </author>
1085      <author initials="J." surname="Mogul" fullname="J. Mogul">
1086         <organization>Compaq Computer Corporation</organization>
1087         <address><email></email></address>
1088      </author>
1089      <author initials="H." surname="Frystyk" fullname="H. Frystyk">
1090         <organization>MIT Laboratory for Computer Science</organization>
1091         <address><email></email></address>
1092      </author>
1093      <author initials="L." surname="Masinter" fullname="L. Masinter">
1094         <organization>Xerox Corporation</organization>
1095         <address><email></email></address>
1096      </author>
1097      <author initials="P." surname="Leach" fullname="P. Leach">
1098         <organization>Microsoft Corporation</organization>
1099         <address><email></email></address>
1100      </author>
1101      <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
1102         <organization>W3C</organization>
1103         <address><email></email></address>
1104      </author>
1105      <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1106         <organization abbrev="W3C">World Wide Web Consortium</organization>
1107         <address><email></email></address>
1108      </author>
1109      <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1110         <organization abbrev="greenbytes">greenbytes GmbH</organization>
1111         <address><email></email></address>
1112      </author>
1113      <date month="June" year="1999"/>
1114   </front>
1115   <seriesInfo name="RFC" value="2616"/>
1118<reference anchor="RFC2119">
1119  <front>
1120    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
1121    <author initials="S." surname="Bradner" fullname="Scott Bradner">
1122      <organization>Harvard University</organization>
1123      <address><email></email></address>
1124    </author>
1125    <date month="March" year="1997"/>
1126  </front>
1127  <seriesInfo name="BCP" value="14"/>
1128  <seriesInfo name="RFC" value="2119"/>
1131<reference anchor="RFC2068">
1132  <front>
1133    <title abbrev="HTTP/1.1">Hypertext Transfer Protocol -- HTTP/1.1</title>
1134    <author initials="R." surname="Fielding" fullname="Roy T. Fielding">
1135      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
1136      <address><email></email></address>
1137    </author>
1138    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1139      <organization>MIT Laboratory for Computer Science</organization>
1140      <address><email></email></address>
1141    </author>
1142    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1143      <organization>Digital Equipment Corporation, Western Research Laboratory</organization>
1144      <address><email></email></address>
1145    </author>
1146    <author initials="H." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
1147      <organization>MIT Laboratory for Computer Science</organization>
1148      <address><email></email></address>
1149    </author>
1150    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1151      <organization>MIT Laboratory for Computer Science</organization>
1152      <address><email></email></address>
1153    </author>
1154    <date month="January" year="1997"/>
1155  </front>
1156  <seriesInfo name="RFC" value="2068"/>
Note: See TracBrowser for help on using the repository browser.