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

Last change on this file since 153 was 153, checked in by julian.reschke@…, 13 years ago

Update "Editorial Note" stating that we now have incorporated everything that was in draft-lafon-rfc2616bis-03.

  • Property svn:eol-style set to native
File size: 50.3 KB
1<?xml version="1.0" encoding="utf-8"?>
2<?xml-stylesheet type='text/xsl' href='../myxml2rfc.xslt'?>
3<!DOCTYPE rfc [
4  <!ENTITY MAY "<bcp14 xmlns=''>MAY</bcp14>">
5  <!ENTITY MUST "<bcp14 xmlns=''>MUST</bcp14>">
6  <!ENTITY MUST-NOT "<bcp14 xmlns=''>MUST NOT</bcp14>">
7  <!ENTITY OPTIONAL "<bcp14 xmlns=''>OPTIONAL</bcp14>">
8  <!ENTITY RECOMMENDED "<bcp14 xmlns=''>RECOMMENDED</bcp14>">
9  <!ENTITY REQUIRED "<bcp14 xmlns=''>REQUIRED</bcp14>">
10  <!ENTITY SHALL "<bcp14 xmlns=''>SHALL</bcp14>">
11  <!ENTITY SHALL-NOT "<bcp14 xmlns=''>SHALL NOT</bcp14>">
12  <!ENTITY SHOULD "<bcp14 xmlns=''>SHOULD</bcp14>">
13  <!ENTITY SHOULD-NOT "<bcp14 xmlns=''>SHOULD NOT</bcp14>">
14  <!ENTITY ID-VERSION "latest">
15  <!ENTITY ID-MONTH "January">
16  <!ENTITY ID-YEAR "2008">
17  <!ENTITY messaging                  "<xref target='Part1' 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="2616" category="std"
33     ipr="full3978" docName="draft-ietf-httpbis-p4-conditional-&ID-VERSION;"
34     xmlns:x=''>
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    Discussion of this draft should take place on the HTTPBIS working group
194    mailing list ( The current issues list is
195    at <eref target=""/>
196    and related documents (including fancy diffs) can be found at
197    <eref target=""/>.
198  </t>
199  <t>
200    This draft incorporates those issue resolutions that were either
201    collected in the original RFC2616 errata list (<eref target=""/>),
202    or which were agreed upon on the mailing list between October 2006 and
203    November 2007 (as published in "draft-lafon-rfc2616bis-03").
204  </t>
208<section title="Introduction" anchor="introduction">
210   This document will define aspects of HTTP related to conditional
211   request messages based on time stamps and entity-tags.  Right now it
212   only includes the extracted relevant sections of <xref target="RFC2616">RFC 2616</xref>
213   without edit.
216<section title="Requirements" anchor="intro.requirements">
218   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
219   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
220   document are to be interpreted as described in <xref target="RFC2119"/>.
223   An implementation is not compliant if it fails to satisfy one or more
224   of the &MUST; or &REQUIRED; level requirements for the protocols it
225   implements. An implementation that satisfies all the &MUST; or &REQUIRED;
226   level and all the &SHOULD; level requirements for its protocols is said
227   to be "unconditionally compliant"; one that satisfies all the &MUST;
228   level requirements but not all the &SHOULD; level requirements for its
229   protocols is said to be "conditionally compliant."
234<section title="Entity Tags" anchor="entity.tags">
236   Entity tags are used for comparing two or more entities from the same
237   requested resource. HTTP/1.1 uses entity tags in the ETag (<xref target="header.etag"/>),
238   If-Match (<xref target="header.if-match"/>), If-None-Match (<xref target="header.if-none-match"/>), and
239   If-Range (&header-if-range;) header fields. The definition of how they
240   are used and compared as cache validators is in <xref target="weak.and.strong.validators"/>. An
241   entity tag consists of an opaque quoted string, possibly prefixed by
242   a weakness indicator.
244<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"/>
245  entity-tag = [ weak ] opaque-tag
246  weak       = "W/"
247  opaque-tag = quoted-string
250   A "strong entity tag" &MAY; be shared by two entities of a resource
251   only if they are equivalent by octet equality.
254   A "weak entity tag," indicated by the "W/" prefix, &MAY; be shared by
255   two entities of a resource only if the entities are equivalent and
256   could be substituted for each other with no significant change in
257   semantics. A weak entity tag can only be used for weak comparison.
260   An entity tag &MUST; be unique across all versions of all entities
261   associated with a particular resource. A given entity tag value &MAY;
262   be used for entities obtained by requests on different URIs. The use
263   of the same entity tag value in conjunction with entities obtained by
264   requests on different URIs does not imply the equivalence of those
265   entities.
269<section title="Status Code Definitions">
270<section title="304 Not Modified" anchor="status.304">
271  <iref primary="true" item="304 Not Modified (status code)" x:for-anchor=""/>
272  <iref primary="true" item="Status Codes" subitem="304 Not Modified" x:for-anchor=""/>
274   If the client has performed a conditional GET request and access is
275   allowed, but the document has not been modified, the server &SHOULD;
276   respond with this status code. The 304 response &MUST-NOT; contain a
277   message-body, and thus is always terminated by the first empty line
278   after the header fields.
281   The response &MUST; include the following header fields:
282  <list style="symbols">
283    <t>Date, unless its omission is required by &clockless;</t>
284  </list>
287   If a clockless origin server obeys these rules, and proxies and
288   clients add their own Date to any response received without one (as
289   already specified by <xref target="RFC2068" x:sec="14.19" x:fmt=","/>), caches will operate
290   correctly.
291  <list style="symbols">
292    <t>ETag and/or Content-Location, if the header would have been sent
293        in a 200 response to the same request</t>
294    <t>Expires, Cache-Control, and/or Vary, if the field-value might
295        differ from that sent in any previous response for the same
296        variant</t>
297  </list>
300   If the conditional GET used a strong cache validator (see <xref target="weak.and.strong.validators"/>),
301   the response &SHOULD-NOT;  include other entity-headers.
302   Otherwise (i.e., the conditional GET used a weak validator), the
303   response &MUST-NOT; include other entity-headers; this prevents
304   inconsistencies between cached entity-bodies and updated headers.
307   If a 304 response indicates an entity not currently cached, then the
308   cache &MUST; disregard the response and repeat the request without the
309   conditional.
312   If a cache uses a received 304 response to update a cache entry, the
313   cache &MUST; update the entry to reflect any new field values given in
314   the response.
318<section title="412 Precondition Failed" anchor="status.412">
319  <iref primary="true" item="412 Precondition Failed (status code)" x:for-anchor=""/>
320  <iref primary="true" item="Status Codes" subitem="412 Precondition Failed" x:for-anchor=""/>
322   The precondition given in one or more of the request-header fields
323   evaluated to false when it was tested on the server. This response
324   code allows the client to place preconditions on the current resource
325   metainformation (header field data) and thus prevent the requested
326   method from being applied to a resource other than the one intended.
331<section title="Weak and Strong Validators" anchor="weak.and.strong.validators">
333   Since both origin servers and caches will compare two validators to
334   decide if they represent the same or different entities, one normally
335   would expect that if the entity (the entity-body or any entity-headers)
336   changes in any way, then the associated validator would
337   change as well. If this is true, then we call this validator a
338   "strong validator."
341   However, there might be cases when a server prefers to change the
342   validator only on semantically significant changes, and not when
343   insignificant aspects of the entity change. A validator that does not
344   always change when the resource changes is a "weak validator."
347   Entity tags are normally "strong validators," but the protocol
348   provides a mechanism to tag an entity tag as "weak." One can think of
349   a strong validator as one that changes whenever the bits of an entity
350   changes, while a weak value changes whenever the meaning of an entity
351   changes. Alternatively, one can think of a strong validator as part
352   of an identifier for a specific entity, while a weak validator is
353   part of an identifier for a set of semantically equivalent entities.
354  <list><t>
355      <x:h>Note:</x:h> One example of a strong validator is an integer that is
356      incremented in stable storage every time an entity is changed.
357    </t><t>
358      An entity's modification time, if represented with one-second
359      resolution, could be a weak validator, since it is possible that
360      the resource might be modified twice during a single second.
361    </t><t>
362      Support for weak validators is optional. However, weak validators
363      allow for more efficient caching of equivalent objects; for
364      example, a hit counter on a site is probably good enough if it is
365      updated every few days or weeks, and any value during that period
366      is likely "good enough" to be equivalent.
367    </t></list>
370   A "use" of a validator is either when a client generates a request
371   and includes the validator in a validating header field, or when a
372   server compares two validators.
375   Strong validators are usable in any context. Weak validators are only
376   usable in contexts that do not depend on exact equality of an entity.
377   For example, either kind is usable for a conditional GET of a full
378   entity. However, only a strong validator is usable for a sub-range
379   retrieval, since otherwise the client might end up with an internally
380   inconsistent entity.
383   Clients &MAY; issue simple (non-subrange) GET requests with either weak
384   validators or strong validators. Clients &MUST-NOT; use weak validators
385   in other forms of request.
388   The only function that the HTTP/1.1 protocol defines on validators is
389   comparison. There are two validator comparison functions, depending
390   on whether the comparison context allows the use of weak validators
391   or not:
392  <list style="symbols">
393     <t>The strong comparison function: in order to be considered equal,
394        both validators &MUST; be identical in every way, and both &MUST-NOT;
395        be weak.</t>
396     <t>The weak comparison function: in order to be considered equal,
397        both validators &MUST; be identical in every way, but either or
398        both of them &MAY; be tagged as "weak" without affecting the
399        result.</t>
400  </list>
403   An entity tag is strong unless it is explicitly tagged as weak.
404   <xref target="entity.tags"/> gives the syntax for entity tags.
407   A Last-Modified time, when used as a validator in a request, is
408   implicitly weak unless it is possible to deduce that it is strong,
409   using the following rules:
410  <list style="symbols">
411     <t>The validator is being compared by an origin server to the
412        actual current validator for the entity and,</t>
413     <t>That origin server reliably knows that the associated entity did
414        not change twice during the second covered by the presented
415        validator.</t>
416  </list>
419   or
420  <list style="symbols">
421     <t>The validator is about to be used by a client in an If-Modified-Since
422        or If-Unmodified-Since header, because the client
423        has a cache entry for the associated entity, and</t>
424     <t>That cache entry includes a Date value, which gives the time
425        when the origin server sent the original response, and</t>
426     <t>The presented Last-Modified time is at least 60 seconds before
427        the Date value.</t>
428  </list>
431   or
432  <list style="symbols">
433     <t>The validator is being compared by an intermediate cache to the
434        validator stored in its cache entry for the entity, and</t>
435     <t>That cache entry includes a Date value, which gives the time
436        when the origin server sent the original response, and</t>
437     <t>The presented Last-Modified time is at least 60 seconds before
438        the Date value.</t>
439  </list>
442   This method relies on the fact that if two different responses were
443   sent by the origin server during the same second, but both had the
444   same Last-Modified time, then at least one of those responses would
445   have a Date value equal to its Last-Modified time. The arbitrary 60-second
446   limit guards against the possibility that the Date and Last-Modified
447   values are generated from different clocks, or at somewhat
448   different times during the preparation of the response. An
449   implementation &MAY; use a value larger than 60 seconds, if it is
450   believed that 60 seconds is too short.
453   If a client wishes to perform a sub-range retrieval on a value for
454   which it has only a Last-Modified time and no opaque validator, it
455   &MAY; do this only if the Last-Modified time is strong in the sense
456   described here.
459   A cache or origin server receiving a conditional request, other than
460   a full-body GET request, &MUST; use the strong comparison function to
461   evaluate the condition.
464   These rules allow HTTP/1.1 caches and clients to safely perform sub-range
465   retrievals on values that have been obtained from HTTP/1.0
466   servers.
470<section title="Rules for When to Use Entity Tags and Last-Modified Dates" anchor="">
472   We adopt a set of rules and recommendations for origin servers,
473   clients, and caches regarding when various validator types ought to
474   be used, and for what purposes.
477   HTTP/1.1 origin servers:
478  <list style="symbols">
479     <t>&SHOULD; send an entity tag validator unless it is not feasible to
480        generate one.</t>
482     <t>&MAY; send a weak entity tag instead of a strong entity tag, if
483        performance considerations support the use of weak entity tags,
484        or if it is unfeasible to send a strong entity tag.</t>
486     <t>&SHOULD; send a Last-Modified value if it is feasible to send one,
487        unless the risk of a breakdown in semantic transparency that
488        could result from using this date in an If-Modified-Since header
489        would lead to serious problems.</t>
490  </list>
493   In other words, the preferred behavior for an HTTP/1.1 origin server
494   is to send both a strong entity tag and a Last-Modified value.
497   In order to be legal, a strong entity tag &MUST; change whenever the
498   associated entity value changes in any way. A weak entity tag &SHOULD;
499   change whenever the associated entity changes in a semantically
500   significant way.
501  <list><t>
502      <x:h>Note:</x:h> in order to provide semantically transparent caching, an
503      origin server must avoid reusing a specific strong entity tag
504      value for two different entities, or reusing a specific weak
505      entity tag value for two semantically different entities. Cache
506      entries might persist for arbitrarily long periods, regardless of
507      expiration times, so it might be inappropriate to expect that a
508      cache will never again attempt to validate an entry using a
509      validator that it obtained at some point in the past.
510  </t></list>
513   HTTP/1.1 clients:
514  <list style="symbols">
515     <t>If an entity tag has been provided by the origin server, &MUST;
516        use that entity tag in any cache-conditional request (using If-Match
517        or If-None-Match).</t>
519     <t>If only a Last-Modified value has been provided by the origin
520        server, &SHOULD; use that value in non-subrange cache-conditional
521        requests (using If-Modified-Since).</t>
523     <t>If only a Last-Modified value has been provided by an HTTP/1.0
524        origin server, &MAY; use that value in subrange cache-conditional
525        requests (using If-Unmodified-Since:). The user agent &SHOULD;
526        provide a way to disable this, in case of difficulty.</t>
528     <t>If both an entity tag and a Last-Modified value have been
529        provided by the origin server, &SHOULD; use both validators in
530        cache-conditional requests. This allows both HTTP/1.0 and
531        HTTP/1.1 caches to respond appropriately.</t>
532  </list>
535   An HTTP/1.1 origin server, upon receiving a conditional request that
536   includes both a Last-Modified date (e.g., in an If-Modified-Since or
537   If-Unmodified-Since header field) and one or more entity tags (e.g.,
538   in an If-Match, If-None-Match, or If-Range header field) as cache
539   validators, &MUST-NOT; return a response status of 304 (Not Modified)
540   unless doing so is consistent with all of the conditional header
541   fields in the request.
544   An HTTP/1.1 caching proxy, upon receiving a conditional request that
545   includes both a Last-Modified date and one or more entity tags as
546   cache validators, &MUST-NOT; return a locally cached response to the
547   client unless that cached response is consistent with all of the
548   conditional header fields in the request.
549  <list><t>
550      <x:h>Note:</x:h> The general principle behind these rules is that HTTP/1.1
551      servers and clients should transmit as much non-redundant
552      information as is available in their responses and requests.
553      HTTP/1.1 systems receiving this information will make the most
554      conservative assumptions about the validators they receive.
555  </t><t>
556      HTTP/1.0 clients and caches will ignore entity tags. Generally,
557      last-modified values received or used by these systems will
558      support transparent and efficient caching, and so HTTP/1.1 origin
559      servers should provide Last-Modified values. In those rare cases
560      where the use of a Last-Modified value as a validator by an
561      HTTP/1.0 system could result in a serious problem, then HTTP/1.1
562      origin servers should not provide one.
563  </t></list>
567<section title="Header Field Definitions" anchor="header.fields">
569   This section defines the syntax and semantics of HTTP/1.1 header fields
570   related to conditional requests.
573   For entity-header fields, both sender and recipient refer to either the
574   client or the server, depending on who sends and who receives the entity.
577<section title="ETag" anchor="header.etag">
578  <iref primary="true" item="ETag header" x:for-anchor=""/>
579  <iref primary="true" item="Headers" subitem="ETag" x:for-anchor=""/>
581   The ETag response-header field provides the current value of the
582   entity tag for the requested variant. The headers used with entity
583   tags are described in Sections <xref target="header.if-match" format="counter"/>
584   and <xref target="header.if-none-match" format="counter"/> of this document,
585   and in &header-if-range;. The entity tag
586   &MAY; be used for comparison with other entities from the same resource
587   (see <xref target="weak.and.strong.validators"/>).
589<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="ETag"/>
590  ETag = "ETag" ":" entity-tag
593   Examples:
595<artwork type="example">
596   ETag: "xyzzy"
597   ETag: W/"xyzzy"
598   ETag: ""
602<section title="If-Match" anchor="header.if-match">
603  <iref primary="true" item="If-Match header" x:for-anchor=""/>
604  <iref primary="true" item="Headers" subitem="If-Match" x:for-anchor=""/>
606   The If-Match request-header field is used with a method to make it
607   conditional. A client that has one or more entities previously
608   obtained from the resource can verify that one of those entities is
609   current by including a list of their associated entity tags in the
610   If-Match header field. Entity tags are defined in <xref target="entity.tags"/>. The
611   purpose of this feature is to allow efficient updates of cached
612   information with a minimum amount of transaction overhead. It is also
613   used, on updating requests, to prevent inadvertent modification of
614   the wrong version of a resource. As a special case, the value "*"
615   matches any current entity of the resource.
617<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Match"/>
618  If-Match = "If-Match" ":" ( "*" | 1#entity-tag )
621   If any of the entity tags match the entity tag of the entity that
622   would have been returned in the response to a similar GET request
623   (without the If-Match header) on that resource, or if "*" is given
624   and any current entity exists for that resource, then the server &MAY;
625   perform the requested method as if the If-Match header field did not
626   exist.
629   A server &MUST; use the strong comparison function (see <xref target="weak.and.strong.validators"/>)
630   to compare the entity tags in If-Match.
633   If none of the entity tags match, or if "*" is given and no current
634   entity exists, the server &MUST-NOT; perform the requested method, and
635   &MUST; return a 412 (Precondition Failed) response. This behavior is
636   most useful when the client wants to prevent an updating method, such
637   as PUT, from modifying a resource that has changed since the client
638   last retrieved it.
641   If the request would, without the If-Match header field, result in
642   anything other than a 2xx or 412 status, then the If-Match header
643   &MUST; be ignored.
646   The meaning of "If-Match: *" is that the method &SHOULD; be performed
647   if the representation selected by the origin server (or by a cache,
648   possibly using the Vary mechanism, see &header-vary;) exists, and
649   &MUST-NOT; be performed if the representation does not exist.
652   A request intended to update a resource (e.g., a PUT) &MAY; include an
653   If-Match header field to signal that the request method &MUST-NOT; be
654   applied if the entity corresponding to the If-Match value (a single
655   entity tag) is no longer a representation of that resource. This
656   allows the user to indicate that they do not wish the request to be
657   successful if the resource has been changed without their knowledge.
658   Examples:
660<figure><artwork type="example">
661    If-Match: "xyzzy"
662    If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
663    If-Match: *
666   The result of a request having both an If-Match header field and
667   either an If-None-Match or an If-Modified-Since header fields is
668   undefined by this specification.
672<section title="If-Modified-Since" anchor="header.if-modified-since">
673  <iref primary="true" item="If-Modified-Since header" x:for-anchor=""/>
674  <iref primary="true" item="Headers" subitem="If-Modified-Since" x:for-anchor=""/>
676   The If-Modified-Since request-header field is used with a method to
677   make it conditional: if the requested variant has not been modified
678   since the time specified in this field, an entity will not be
679   returned from the server; instead, a 304 (Not Modified) response will
680   be returned without any message-body.
682<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Modified-Since"/>
683  If-Modified-Since = "If-Modified-Since" ":" HTTP-date
686   An example of the field is:
688<figure><artwork type="example">
689    If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
692   A GET method with an If-Modified-Since header and no Range header
693   requests that the identified entity be transferred only if it has
694   been modified since the date given by the If-Modified-Since header.
695   The algorithm for determining this includes the following cases:
696  <list style="numbers">
697      <t>If the request would normally result in anything other than a
698         200 (OK) status, or if the passed If-Modified-Since date is
699         invalid, the response is exactly the same as for a normal GET.
700         A date which is later than the server's current time is
701         invalid.</t>
703      <t>If the variant has been modified since the If-Modified-Since
704         date, the response is exactly the same as for a normal GET.</t>
706      <t>If the variant has not been modified since a valid If-Modified-Since
707         date, the server &SHOULD; return a 304 (Not
708         Modified) response.</t>
709  </list>
712   The purpose of this feature is to allow efficient updates of cached
713   information with a minimum amount of transaction overhead.
714  <list><t>
715      <x:h>Note:</x:h> The Range request-header field modifies the meaning of If-Modified-Since;
716      see &header-range; for full details.
717    </t><t>
718      <x:h>Note:</x:h> If-Modified-Since times are interpreted by the server, whose
719      clock might not be synchronized with the client.
720    </t><t>
721      <x:h>Note:</x:h> When handling an If-Modified-Since header field, some
722      servers will use an exact date comparison function, rather than a
723      less-than function, for deciding whether to send a 304 (Not
724      Modified) response. To get best results when sending an If-Modified-Since
725      header field for cache validation, clients are
726      advised to use the exact date string received in a previous Last-Modified
727      header field whenever possible.
728    </t><t>
729      <x:h>Note:</x:h> If a client uses an arbitrary date in the If-Modified-Since
730      header instead of a date taken from the Last-Modified header for
731      the same request, the client should be aware of the fact that this
732      date is interpreted in the server's understanding of time. The
733      client should consider unsynchronized clocks and rounding problems
734      due to the different encodings of time between the client and
735      server. This includes the possibility of race conditions if the
736      document has changed between the time it was first requested and
737      the If-Modified-Since date of a subsequent request, and the
738      possibility of clock-skew-related problems if the If-Modified-Since
739      date is derived from the client's clock without correction
740      to the server's clock. Corrections for different time bases
741      between client and server are at best approximate due to network
742      latency.
743    </t>
744  </list>
747   The result of a request having both an If-Modified-Since header field
748   and either an If-Match or an If-Unmodified-Since header fields is
749   undefined by this specification.
753<section title="If-None-Match" anchor="header.if-none-match">
754  <iref primary="true" item="If-None-Match header" x:for-anchor=""/>
755  <iref primary="true" item="Headers" subitem="If-None-Match" x:for-anchor=""/>
757   The If-None-Match request-header field is used with a method to make
758   it conditional. A client that has one or more entities previously
759   obtained from the resource can verify that none of those entities is
760   current by including a list of their associated entity tags in the
761   If-None-Match header field. The purpose of this feature is to allow
762   efficient updates of cached information with a minimum amount of
763   transaction overhead. It is also used to prevent a method (e.g. PUT)
764   from inadvertently modifying an existing resource when the client
765   believes that the resource does not exist.
768   As a special case, the value "*" matches any current entity of the
769   resource.
771<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-None-Match"/>
772  If-None-Match = "If-None-Match" ":" ( "*" | 1#entity-tag )
775   If any of the entity tags match the entity tag of the entity that
776   would have been returned in the response to a similar GET request
777   (without the If-None-Match header) on that resource, or if "*" is
778   given and any current entity exists for that resource, then the
779   server &MUST-NOT; perform the requested method, unless required to do
780   so because the resource's modification date fails to match that
781   supplied in an If-Modified-Since header field in the request.
782   Instead, if the request method was GET or HEAD, the server &SHOULD;
783   respond with a 304 (Not Modified) response, including the cache-related
784   header fields (particularly ETag) of one of the entities that
785   matched. For all other request methods, the server &MUST; respond with
786   a status of 412 (Precondition Failed).
789   See <xref target="weak.and.strong.validators"/> for rules on how to determine if two entities tags
790   match. The weak comparison function can only be used with GET or HEAD
791   requests.
794   If none of the entity tags match, then the server &MAY; perform the
795   requested method as if the If-None-Match header field did not exist,
796   but &MUST; also ignore any If-Modified-Since header field(s) in the
797   request. That is, if no entity tags match, then the server &MUST-NOT;
798   return a 304 (Not Modified) response.
801   If the request would, without the If-None-Match header field, result
802   in anything other than a 2xx or 304 status, then the If-None-Match
803   header &MUST; be ignored. (See <xref target=""/> for a discussion of
804   server behavior when both If-Modified-Since and If-None-Match appear
805   in the same request.)
808   The meaning of "If-None-Match: *" is that the method &MUST-NOT; be
809   performed if the representation selected by the origin server (or by
810   a cache, possibly using the Vary mechanism, see &header-vary;)
811   exists, and &SHOULD; be performed if the representation does not exist.
812   This feature is intended to be useful in preventing races between PUT
813   operations.
816   Examples:
818<figure><artwork type="example">
819    If-None-Match: "xyzzy"
820    If-None-Match: W/"xyzzy"
821    If-None-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
822    If-None-Match: W/"xyzzy", W/"r2d2xxxx", W/"c3piozzzz"
823    If-None-Match: *
826   The result of a request having both an If-None-Match header field and
827   either an If-Match or an If-Unmodified-Since header fields is
828   undefined by this specification.
832<section title="If-Unmodified-Since" anchor="header.if-unmodified-since">
833  <iref primary="true" item="If-Unmodified-Since header" x:for-anchor=""/>
834  <iref primary="true" item="Headers" subitem="If-Unmodified-Since" x:for-anchor=""/>
836   The If-Unmodified-Since request-header field is used with a method to
837   make it conditional. If the requested resource has not been modified
838   since the time specified in this field, the server &SHOULD; perform the
839   requested operation as if the If-Unmodified-Since header were not
840   present.
843   If the requested variant has been modified since the specified time,
844   the server &MUST-NOT; perform the requested operation, and &MUST; return
845   a 412 (Precondition Failed).
847<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Unmodified-Since"/>
848  If-Unmodified-Since = "If-Unmodified-Since" ":" HTTP-date
851   An example of the field is:
853<figure><artwork type="example">
854    If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT
857   If the request normally (i.e., without the If-Unmodified-Since
858   header) would result in anything other than a 2xx or 412 status, the
859   If-Unmodified-Since header &SHOULD; be ignored.
862   If the specified date is invalid, the header is ignored.
865   The result of a request having both an If-Unmodified-Since header
866   field and either an If-None-Match or an If-Modified-Since header
867   fields is undefined by this specification.
871<section title="Last-Modified" anchor="header.last-modified">
872  <iref primary="true" item="Last-Modified header" x:for-anchor=""/>
873  <iref primary="true" item="Headers" subitem="Last-Modified" x:for-anchor=""/>
875   The Last-Modified entity-header field indicates the date and time at
876   which the origin server believes the variant was last modified.
878<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Last-Modified"/>
879  Last-Modified  = "Last-Modified" ":" HTTP-date
882   An example of its use is
884<figure><artwork type="example">
885    Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT
888   The exact meaning of this header field depends on the implementation
889   of the origin server and the nature of the original resource. For
890   files, it may be just the file system last-modified time. For
891   entities with dynamically included parts, it may be the most recent
892   of the set of last-modify times for its component parts. For database
893   gateways, it may be the last-update time stamp of the record. For
894   virtual objects, it may be the last time the internal state changed.
897   An origin server &MUST-NOT; send a Last-Modified date which is later
898   than the server's time of message origination. In such cases, where
899   the resource's last modification would indicate some time in the
900   future, the server &MUST; replace that date with the message
901   origination date.
904   An origin server &SHOULD; obtain the Last-Modified value of the entity
905   as close as possible to the time that it generates the Date value of
906   its response. This allows a recipient to make an accurate assessment
907   of the entity's modification time, especially if the entity changes
908   near the time that the response is generated.
911   HTTP/1.1 servers &SHOULD; send Last-Modified whenever feasible.
917<section title="IANA Considerations" anchor="IANA.considerations">
919   TBD.
923<section title="Security Considerations" anchor="security.considerations">
925   No additional security considerations have been identified beyond
926   those applicable to HTTP in general &messaging;.
930<section title="Acknowledgments" anchor="ack">
935<references title="Normative References">
937<reference anchor="Part1">
938  <front>
939    <title abbrev="HTTP/1.1">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</title>
940    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
941      <organization abbrev="Day Software">Day Software</organization>
942      <address><email></email></address>
943    </author>
944    <author initials="J." surname="Gettys" fullname="Jim Gettys">
945      <organization>One Laptop per Child</organization>
946      <address><email></email></address>
947    </author>
948    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
949      <organization abbrev="HP">Hewlett-Packard Company</organization>
950      <address><email></email></address>
951    </author>
952    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
953      <organization abbrev="Microsoft">Microsoft Corporation</organization>
954      <address><email></email></address>
955    </author>
956    <author initials="L." surname="Masinter" fullname="Larry Masinter">
957      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
958      <address><email></email></address>
959    </author>
960    <author initials="P." surname="Leach" fullname="Paul J. Leach">
961      <organization abbrev="Microsoft">Microsoft Corporation</organization>
962      <address><email></email></address>
963    </author>
964    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
965      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
966      <address><email></email></address>
967    </author>
968    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
969      <organization abbrev="W3C">World Wide Web Consortium</organization>
970      <address><email></email></address>
971    </author>
972    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
973      <organization abbrev="greenbytes">greenbytes GmbH</organization>
974      <address><email></email></address>
975    </author>
976    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
977  </front>
978  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"/>
979  <x:source href="p1-messaging.xml" basename="p1-messaging"/>
982<reference anchor="Part5">
983  <front>
984    <title abbrev="HTTP/1.1">HTTP/1.1, part 5: Range Requests and Partial Responses</title>
985    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
986      <organization abbrev="Day Software">Day Software</organization>
987      <address><email></email></address>
988    </author>
989    <author initials="J." surname="Gettys" fullname="Jim Gettys">
990      <organization>One Laptop per Child</organization>
991      <address><email></email></address>
992    </author>
993    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
994      <organization abbrev="HP">Hewlett-Packard Company</organization>
995      <address><email></email></address>
996    </author>
997    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
998      <organization abbrev="Microsoft">Microsoft Corporation</organization>
999      <address><email></email></address>
1000    </author>
1001    <author initials="L." surname="Masinter" fullname="Larry Masinter">
1002      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1003      <address><email></email></address>
1004    </author>
1005    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1006      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1007      <address><email></email></address>
1008    </author>
1009    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1010      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1011      <address><email></email></address>
1012    </author>
1013    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1014      <organization abbrev="W3C">World Wide Web Consortium</organization>
1015      <address><email></email></address>
1016    </author>
1017    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1018      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1019      <address><email></email></address>
1020    </author>
1021    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1022  </front>
1023  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p5-range-&ID-VERSION;"/>
1024  <x:source href="p5-range.xml" basename="p5-range"/>
1027<reference anchor="Part6">
1028  <front>
1029    <title abbrev="HTTP/1.1">HTTP/1.1, part 6: Caching</title>
1030    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1031      <organization abbrev="Day Software">Day Software</organization>
1032      <address><email></email></address>
1033    </author>
1034    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1035      <organization>One Laptop per Child</organization>
1036      <address><email></email></address>
1037    </author>
1038    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1039      <organization abbrev="HP">Hewlett-Packard Company</organization>
1040      <address><email></email></address>
1041    </author>
1042    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1043      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1044      <address><email></email></address>
1045    </author>
1046    <author initials="L." surname="Masinter" fullname="Larry Masinter">
1047      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1048      <address><email></email></address>
1049    </author>
1050    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1051      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1052      <address><email></email></address>
1053    </author>
1054    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1055      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1056      <address><email></email></address>
1057    </author>
1058    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1059      <organization abbrev="W3C">World Wide Web Consortium</organization>
1060      <address><email></email></address>
1061    </author>
1062    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1063      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1064      <address><email></email></address>
1065    </author>
1066    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1067  </front>
1068  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-&ID-VERSION;"/>
1069  <x:source href="p6-cache.xml" basename="p6-cache"/>
1072<reference anchor="RFC2119">
1073  <front>
1074    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
1075    <author initials="S." surname="Bradner" fullname="Scott Bradner">
1076      <organization>Harvard University</organization>
1077      <address><email></email></address>
1078    </author>
1079    <date month="March" year="1997"/>
1080  </front>
1081  <seriesInfo name="BCP" value="14"/>
1082  <seriesInfo name="RFC" value="2119"/>
1087<references title="Informative References">
1089<reference anchor="RFC2068">
1090  <front>
1091    <title abbrev="HTTP/1.1">Hypertext Transfer Protocol -- HTTP/1.1</title>
1092    <author initials="R." surname="Fielding" fullname="Roy T. Fielding">
1093      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
1094      <address><email></email></address>
1095    </author>
1096    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1097      <organization>MIT Laboratory for Computer Science</organization>
1098      <address><email></email></address>
1099    </author>
1100    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1101      <organization>Digital Equipment Corporation, Western Research Laboratory</organization>
1102      <address><email></email></address>
1103    </author>
1104    <author initials="H." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
1105      <organization>MIT Laboratory for Computer Science</organization>
1106      <address><email></email></address>
1107    </author>
1108    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1109      <organization>MIT Laboratory for Computer Science</organization>
1110      <address><email></email></address>
1111    </author>
1112    <date month="January" year="1997"/>
1113  </front>
1114  <seriesInfo name="RFC" value="2068"/>
1117<reference anchor="RFC2616">
1118  <front>
1119    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
1120    <author initials="R." surname="Fielding" fullname="R. Fielding">
1121      <organization>University of California, Irvine</organization>
1122      <address><email></email></address>
1123    </author>
1124    <author initials="J." surname="Gettys" fullname="J. Gettys">
1125      <organization>W3C</organization>
1126      <address><email></email></address>
1127    </author>
1128    <author initials="J." surname="Mogul" fullname="J. Mogul">
1129      <organization>Compaq Computer Corporation</organization>
1130      <address><email></email></address>
1131    </author>
1132    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
1133      <organization>MIT Laboratory for Computer Science</organization>
1134      <address><email></email></address>
1135    </author>
1136    <author initials="L." surname="Masinter" fullname="L. Masinter">
1137      <organization>Xerox Corporation</organization>
1138      <address><email></email></address>
1139    </author>
1140    <author initials="P." surname="Leach" fullname="P. Leach">
1141      <organization>Microsoft Corporation</organization>
1142      <address><email></email></address>
1143    </author>
1144    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
1145      <organization>W3C</organization>
1146      <address><email></email></address>
1147    </author>
1148    <date month="June" year="1999"/>
1149  </front>
1150  <seriesInfo name="RFC" value="2616"/>
1155<section title="Compatibility with Previous Versions" anchor="compatibility">
1157<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
1162<section title="Change Log (to be removed by RFC Editor before publication)">
1164<section title="Since RFC2616">
1166  Extracted relevant partitions from <xref target="RFC2616"/>.
1170<section title="Since draft-ietf-httpbis-p4-conditional-00">
1172  Closed issues:
1173  <list style="symbols">
1174    <t>
1175      <eref target=""/>:
1176      "Normative and Informative references"
1177    </t>
1178  </list>
1181  Other changes:
1182  <list style="symbols">
1183    <t>
1184      Move definitions of 304 and 412 condition codes from Part2.
1185    </t>
1186  </list>
Note: See TracBrowser for help on using the repository browser.