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

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

List Yves Lafon & Julian Reschke as Editors everywhere, remove specific ack for Julian.

  • Property svn:eol-style set to native
File size: 50.9 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.
224<section title="Entity Tags" anchor="entity.tags">
226   Entity tags are used for comparing two or more entities from the same
227   requested resource. HTTP/1.1 uses entity tags in the ETag (<xref target="header.etag"/>),
228   If-Match (<xref target="header.if-match"/>), If-None-Match (<xref target="header.if-none-match"/>), and
229   If-Range (&header-if-range;) header fields. The definition of how they
230   are used and compared as cache validators is in <xref target="weak.and.strong.validators"/>. An
231   entity tag consists of an opaque quoted string, possibly prefixed by
232   a weakness indicator.
234<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"/>
235   entity-tag = [ weak ] opaque-tag
236   weak       = "W/"
237   opaque-tag = quoted-string
240   A "strong entity tag" &MAY; be shared by two entities of a resource
241   only if they are equivalent by octet equality.
244   A "weak entity tag," indicated by the "W/" prefix, &MAY; be shared by
245   two entities of a resource only if the entities are equivalent and
246   could be substituted for each other with no significant change in
247   semantics. A weak entity tag can only be used for weak comparison.
250   An entity tag &MUST; be unique across all versions of all entities
251   associated with a particular resource. A given entity tag value &MAY;
252   be used for entities obtained by requests on different URIs. The use
253   of the same entity tag value in conjunction with entities obtained by
254   requests on different URIs does not imply the equivalence of those
255   entities.
259<section title="Status Code Definitions">
260<section title="304 Not Modified" anchor="status.304">
261  <iref primary="true" item="304 Not Modified (status code)" x:for-anchor=""/>
262  <iref primary="true" item="Status Codes" subitem="304 Not Modified" x:for-anchor=""/>
264   If the client has performed a conditional GET request and access is
265   allowed, but the document has not been modified, the server &SHOULD;
266   respond with this status code. The 304 response &MUST-NOT; contain a
267   message-body, and thus is always terminated by the first empty line
268   after the header fields.
271   The response &MUST; include the following header fields:
272  <list style="symbols">
273    <t>Date, unless its omission is required by &clockless;</t>
274  </list>
277   If a clockless origin server obeys these rules, and proxies and
278   clients add their own Date to any response received without one (as
279   already specified by <xref target="RFC2068" />, section <xref target="RFC2068" x:sec="14.19" x:fmt="number"/>), caches will operate
280   correctly.
281  <list style="symbols">
282    <t>ETag and/or Content-Location, if the header would have been sent
283        in a 200 response to the same request</t>
284    <t>Expires, Cache-Control, and/or Vary, if the field-value might
285        differ from that sent in any previous response for the same
286        variant</t>
287  </list>
290   If the conditional GET used a strong cache validator (see &caching;),
291   the response &SHOULD-NOT;  include other entity-headers.
292   Otherwise (i.e., the conditional GET used a weak validator), the
293   response &MUST-NOT; include other entity-headers; this prevents
294   inconsistencies between cached entity-bodies and updated headers.
297   If a 304 response indicates an entity not currently cached, then the
298   cache &MUST; disregard the response and repeat the request without the
299   conditional.
302   If a cache uses a received 304 response to update a cache entry, the
303   cache &MUST; update the entry to reflect any new field values given in
304   the response.
308<section title="412 Precondition Failed" anchor="status.412">
309  <iref primary="true" item="412 Precondition Failed (status code)" x:for-anchor=""/>
310  <iref primary="true" item="Status Codes" subitem="412 Precondition Failed" x:for-anchor=""/>
312   The precondition given in one or more of the request-header fields
313   evaluated to false when it was tested on the server. This response
314   code allows the client to place preconditions on the current resource
315   metainformation (header field data) and thus prevent the requested
316   method from being applied to a resource other than the one intended.
321<section title="Weak and Strong Validators" anchor="weak.and.strong.validators">
323   Since both origin servers and caches will compare two validators to
324   decide if they represent the same or different entities, one normally
325   would expect that if the entity (the entity-body or any entity-headers)
326   changes in any way, then the associated validator would
327   change as well. If this is true, then we call this validator a
328   "strong validator."
331   However, there might be cases when a server prefers to change the
332   validator only on semantically significant changes, and not when
333   insignificant aspects of the entity change. A validator that does not
334   always change when the resource changes is a "weak validator."
337   Entity tags are normally "strong validators," but the protocol
338   provides a mechanism to tag an entity tag as "weak." One can think of
339   a strong validator as one that changes whenever the bits of an entity
340   changes, while a weak value changes whenever the meaning of an entity
341   changes. Alternatively, one can think of a strong validator as part
342   of an identifier for a specific entity, while a weak validator is
343   part of an identifier for a set of semantically equivalent entities.
344  <list><t>
345      <x:h>Note:</x:h> One example of a strong validator is an integer that is
346      incremented in stable storage every time an entity is changed.
347    </t><t>
348      An entity's modification time, if represented with one-second
349      resolution, could be a weak validator, since it is possible that
350      the resource might be modified twice during a single second.
351    </t><t>
352      Support for weak validators is optional. However, weak validators
353      allow for more efficient caching of equivalent objects; for
354      example, a hit counter on a site is probably good enough if it is
355      updated every few days or weeks, and any value during that period
356      is likely "good enough" to be equivalent.
357    </t></list>
360   A "use" of a validator is either when a client generates a request
361   and includes the validator in a validating header field, or when a
362   server compares two validators.
365   Strong validators are usable in any context. Weak validators are only
366   usable in contexts that do not depend on exact equality of an entity.
367   For example, either kind is usable for a conditional GET of a full
368   entity. However, only a strong validator is usable for a sub-range
369   retrieval, since otherwise the client might end up with an internally
370   inconsistent entity.
373   Clients &MAY; issue simple (non-subrange) GET requests with either weak
374   validators or strong validators. Clients &MUST-NOT; use weak validators
375   in other forms of request.
378   The only function that the HTTP/1.1 protocol defines on validators is
379   comparison. There are two validator comparison functions, depending
380   on whether the comparison context allows the use of weak validators
381   or not:
382  <list style="symbols">
383     <t>The strong comparison function: in order to be considered equal,
384        both validators &MUST; be identical in every way, and both &MUST-NOT;
385        be weak.</t>
386     <t>The weak comparison function: in order to be considered equal,
387        both validators &MUST; be identical in every way, but either or
388        both of them &MAY; be tagged as "weak" without affecting the
389        result.</t>
390  </list>
393   An entity tag is strong unless it is explicitly tagged as weak.
394   <xref target="entity.tags"/> gives the syntax for entity tags.
397   A Last-Modified time, when used as a validator in a request, is
398   implicitly weak unless it is possible to deduce that it is strong,
399   using the following rules:
400  <list style="symbols">
401     <t>The validator is being compared by an origin server to the
402        actual current validator for the entity and,</t>
403     <t>That origin server reliably knows that the associated entity did
404        not change twice during the second covered by the presented
405        validator.</t>
406  </list>
409   or
410  <list style="symbols">
411     <t>The validator is about to be used by a client in an If-Modified-Since
412        or If-Unmodified-Since header, because the client
413        has a cache entry for the associated entity, and</t>
414     <t>That cache entry includes a Date value, which gives the time
415        when the origin server sent the original response, and</t>
416     <t>The presented Last-Modified time is at least 60 seconds before
417        the Date value.</t>
418  </list>
421   or
422  <list style="symbols">
423     <t>The validator is being compared by an intermediate cache to the
424        validator stored in its cache entry for the entity, and</t>
425     <t>That cache entry includes a Date value, which gives the time
426        when the origin server sent the original response, and</t>
427     <t>The presented Last-Modified time is at least 60 seconds before
428        the Date value.</t>
429  </list>
432   This method relies on the fact that if two different responses were
433   sent by the origin server during the same second, but both had the
434   same Last-Modified time, then at least one of those responses would
435   have a Date value equal to its Last-Modified time. The arbitrary 60-second
436   limit guards against the possibility that the Date and Last-Modified
437   values are generated from different clocks, or at somewhat
438   different times during the preparation of the response. An
439   implementation &MAY; use a value larger than 60 seconds, if it is
440   believed that 60 seconds is too short.
443   If a client wishes to perform a sub-range retrieval on a value for
444   which it has only a Last-Modified time and no opaque validator, it
445   &MAY; do this only if the Last-Modified time is strong in the sense
446   described here.
449   A cache or origin server receiving a conditional request, other than
450   a full-body GET request, &MUST; use the strong comparison function to
451   evaluate the condition.
454   These rules allow HTTP/1.1 caches and clients to safely perform sub-range
455   retrievals on values that have been obtained from HTTP/1.0
456   servers.
460<section title="Rules for When to Use Entity Tags and Last-Modified Dates" anchor="">
462   We adopt a set of rules and recommendations for origin servers,
463   clients, and caches regarding when various validator types ought to
464   be used, and for what purposes.
467   HTTP/1.1 origin servers:
468  <list style="symbols">
469     <t>&SHOULD; send an entity tag validator unless it is not feasible to
470        generate one.</t>
472     <t>&MAY; send a weak entity tag instead of a strong entity tag, if
473        performance considerations support the use of weak entity tags,
474        or if it is unfeasible to send a strong entity tag.</t>
476     <t>&SHOULD; send a Last-Modified value if it is feasible to send one,
477        unless the risk of a breakdown in semantic transparency that
478        could result from using this date in an If-Modified-Since header
479        would lead to serious problems.</t>
480  </list>
483   In other words, the preferred behavior for an HTTP/1.1 origin server
484   is to send both a strong entity tag and a Last-Modified value.
487   In order to be legal, a strong entity tag &MUST; change whenever the
488   associated entity value changes in any way. A weak entity tag &SHOULD;
489   change whenever the associated entity changes in a semantically
490   significant way.
491  <list><t>
492      <x:h>Note:</x:h> in order to provide semantically transparent caching, an
493      origin server must avoid reusing a specific strong entity tag
494      value for two different entities, or reusing a specific weak
495      entity tag value for two semantically different entities. Cache
496      entries might persist for arbitrarily long periods, regardless of
497      expiration times, so it might be inappropriate to expect that a
498      cache will never again attempt to validate an entry using a
499      validator that it obtained at some point in the past.
500  </t></list>
503   HTTP/1.1 clients:
504  <list style="symbols">
505     <t>If an entity tag has been provided by the origin server, &MUST;
506        use that entity tag in any cache-conditional request (using If-Match
507        or If-None-Match).</t>
509     <t>If only a Last-Modified value has been provided by the origin
510        server, &SHOULD; use that value in non-subrange cache-conditional
511        requests (using If-Modified-Since).</t>
513     <t>If only a Last-Modified value has been provided by an HTTP/1.0
514        origin server, &MAY; use that value in subrange cache-conditional
515        requests (using If-Unmodified-Since:). The user agent &SHOULD;
516        provide a way to disable this, in case of difficulty.</t>
518     <t>If both an entity tag and a Last-Modified value have been
519        provided by the origin server, &SHOULD; use both validators in
520        cache-conditional requests. This allows both HTTP/1.0 and
521        HTTP/1.1 caches to respond appropriately.</t>
522  </list>
525   An HTTP/1.1 origin server, upon receiving a conditional request that
526   includes both a Last-Modified date (e.g., in an If-Modified-Since or
527   If-Unmodified-Since header field) and one or more entity tags (e.g.,
528   in an If-Match, If-None-Match, or If-Range header field) as cache
529   validators, &MUST-NOT; return a response status of 304 (Not Modified)
530   unless doing so is consistent with all of the conditional header
531   fields in the request.
534   An HTTP/1.1 caching proxy, upon receiving a conditional request that
535   includes both a Last-Modified date and one or more entity tags as
536   cache validators, &MUST-NOT; return a locally cached response to the
537   client unless that cached response is consistent with all of the
538   conditional header fields in the request.
539  <list><t>
540      <x:h>Note:</x:h> The general principle behind these rules is that HTTP/1.1
541      servers and clients should transmit as much non-redundant
542      information as is available in their responses and requests.
543      HTTP/1.1 systems receiving this information will make the most
544      conservative assumptions about the validators they receive.
545  </t><t>
546      HTTP/1.0 clients and caches will ignore entity tags. Generally,
547      last-modified values received or used by these systems will
548      support transparent and efficient caching, and so HTTP/1.1 origin
549      servers should provide Last-Modified values. In those rare cases
550      where the use of a Last-Modified value as a validator by an
551      HTTP/1.0 system could result in a serious problem, then HTTP/1.1
552      origin servers should not provide one.
553  </t></list>
557<section title="Header Field Definitions" anchor="header.fields">
559   This section defines the syntax and semantics of all standard
560   HTTP/1.1 header fields. For entity-header fields, both sender and
561   recipient refer to either the client or the server, depending on who
562   sends and who receives the entity.
565<section title="ETag" anchor="header.etag">
566  <iref primary="true" item="ETag header" x:for-anchor=""/>
567  <iref primary="true" item="Headers" subitem="ETag" x:for-anchor=""/>
569   The ETag response-header field provides the current value of the
570   entity tag for the requested variant. The headers used with entity
571   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
572   &MAY; be used for comparison with other entities from the same resource
573   (see <xref target="weak.and.strong.validators"/>).
575<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="ETag"/>
576    ETag = "ETag" ":" entity-tag
579   Examples:
581<artwork type="example">
582   ETag: "xyzzy"
583   ETag: W/"xyzzy"
584   ETag: ""
588<section title="If-Match" anchor="header.if-match">
589  <iref primary="true" item="If-Match header" x:for-anchor=""/>
590  <iref primary="true" item="Headers" subitem="If-Match" x:for-anchor=""/>
592   The If-Match request-header field is used with a method to make it
593   conditional. A client that has one or more entities previously
594   obtained from the resource can verify that one of those entities is
595   current by including a list of their associated entity tags in the
596   If-Match header field. Entity tags are defined in <xref target="entity.tags"/>. The
597   purpose of this feature is to allow efficient updates of cached
598   information with a minimum amount of transaction overhead. It is also
599   used, on updating requests, to prevent inadvertent modification of
600   the wrong version of a resource. As a special case, the value "*"
601   matches any current entity of the resource.
603<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Match"/>
604    If-Match = "If-Match" ":" ( "*" | 1#entity-tag )
607   If any of the entity tags match the entity tag of the entity that
608   would have been returned in the response to a similar GET request
609   (without the If-Match header) on that resource, or if "*" is given
610   and any current entity exists for that resource, then the server &MAY;
611   perform the requested method as if the If-Match header field did not
612   exist.
615   A server &MUST; use the strong comparison function (see <xref target="weak.and.strong.validators"/>)
616   to compare the entity tags in If-Match.
619   If none of the entity tags match, or if "*" is given and no current
620   entity exists, the server &MUST-NOT; perform the requested method, and
621   &MUST; return a 412 (Precondition Failed) response. This behavior is
622   most useful when the client wants to prevent an updating method, such
623   as PUT, from modifying a resource that has changed since the client
624   last retrieved it.
627   If the request would, without the If-Match header field, result in
628   anything other than a 2xx or 412 status, then the If-Match header
629   &MUST; be ignored.
632   The meaning of "If-Match: *" is that the method &SHOULD; be performed
633   if the representation selected by the origin server (or by a cache,
634   possibly using the Vary mechanism, see &header-vary;) exists, and
635   &MUST-NOT; be performed if the representation does not exist.
638   A request intended to update a resource (e.g., a PUT) &MAY; include an
639   If-Match header field to signal that the request method &MUST-NOT; be
640   applied if the entity corresponding to the If-Match value (a single
641   entity tag) is no longer a representation of that resource. This
642   allows the user to indicate that they do not wish the request to be
643   successful if the resource has been changed without their knowledge.
644   Examples:
646<figure><artwork type="example">
647    If-Match: "xyzzy"
648    If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
649    If-Match: *
652   The result of a request having both an If-Match header field and
653   either an If-None-Match or an If-Modified-Since header fields is
654   undefined by this specification.
658<section title="If-Modified-Since" anchor="header.if-modified-since">
659  <iref primary="true" item="If-Modified-Since header" x:for-anchor=""/>
660  <iref primary="true" item="Headers" subitem="If-Modified-Since" x:for-anchor=""/>
662   The If-Modified-Since request-header field is used with a method to
663   make it conditional: if the requested variant has not been modified
664   since the time specified in this field, an entity will not be
665   returned from the server; instead, a 304 (not modified) response will
666   be returned without any message-body.
668<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Modified-Since"/>
669    If-Modified-Since = "If-Modified-Since" ":" HTTP-date
672   An example of the field is:
674<figure><artwork type="example">
675    If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
678   A GET method with an If-Modified-Since header and no Range header
679   requests that the identified entity be transferred only if it has
680   been modified since the date given by the If-Modified-Since header.
681   The algorithm for determining this includes the following cases:
682  <list style="numbers">
683      <t>If the request would normally result in anything other than a
684         200 (OK) status, or if the passed If-Modified-Since date is
685         invalid, the response is exactly the same as for a normal GET.
686         A date which is later than the server's current time is
687         invalid.</t>
689      <t>If the variant has been modified since the If-Modified-Since
690         date, the response is exactly the same as for a normal GET.</t>
692      <t>If the variant has not been modified since a valid If-Modified-Since
693         date, the server &SHOULD; return a 304 (Not
694         Modified) response.</t>
695  </list>
698   The purpose of this feature is to allow efficient updates of cached
699   information with a minimum amount of transaction overhead.
700  <list><t>
701      <x:h>Note:</x:h> The Range request-header field modifies the meaning of If-Modified-Since;
702      see &header-range; for full details.
703    </t><t>
704      <x:h>Note:</x:h> If-Modified-Since times are interpreted by the server, whose
705      clock might not be synchronized with the client.
706    </t><t>
707      <x:h>Note:</x:h> When handling an If-Modified-Since header field, some
708      servers will use an exact date comparison function, rather than a
709      less-than function, for deciding whether to send a 304 (Not
710      Modified) response. To get best results when sending an If-Modified-Since
711      header field for cache validation, clients are
712      advised to use the exact date string received in a previous Last-Modified
713      header field whenever possible.
714    </t><t>
715      <x:h>Note:</x:h> If a client uses an arbitrary date in the If-Modified-Since
716      header instead of a date taken from the Last-Modified header for
717      the same request, the client should be aware of the fact that this
718      date is interpreted in the server's understanding of time. The
719      client should consider unsynchronized clocks and rounding problems
720      due to the different encodings of time between the client and
721      server. This includes the possibility of race conditions if the
722      document has changed between the time it was first requested and
723      the If-Modified-Since date of a subsequent request, and the
724      possibility of clock-skew-related problems if the If-Modified-Since
725      date is derived from the client's clock without correction
726      to the server's clock. Corrections for different time bases
727      between client and server are at best approximate due to network
728      latency.
729    </t>
730  </list>
733   The result of a request having both an If-Modified-Since header field
734   and either an If-Match or an If-Unmodified-Since header fields is
735   undefined by this specification.
739<section title="If-None-Match" anchor="header.if-none-match">
740  <iref primary="true" item="If-None-Match header" x:for-anchor=""/>
741  <iref primary="true" item="Headers" subitem="If-None-Match" x:for-anchor=""/>
743   The If-None-Match request-header field is used with a method to make
744   it conditional. A client that has one or more entities previously
745   obtained from the resource can verify that none of those entities is
746   current by including a list of their associated entity tags in the
747   If-None-Match header field. The purpose of this feature is to allow
748   efficient updates of cached information with a minimum amount of
749   transaction overhead. It is also used to prevent a method (e.g. PUT)
750   from inadvertently modifying an existing resource when the client
751   believes that the resource does not exist.
754   As a special case, the value "*" matches any current entity of the
755   resource.
757<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-None-Match"/>
758    If-None-Match = "If-None-Match" ":" ( "*" | 1#entity-tag )
761   If any of the entity tags match the entity tag of the entity that
762   would have been returned in the response to a similar GET request
763   (without the If-None-Match header) on that resource, or if "*" is
764   given and any current entity exists for that resource, then the
765   server &MUST-NOT; perform the requested method, unless required to do
766   so because the resource's modification date fails to match that
767   supplied in an If-Modified-Since header field in the request.
768   Instead, if the request method was GET or HEAD, the server &SHOULD;
769   respond with a 304 (Not Modified) response, including the cache-related
770   header fields (particularly ETag) of one of the entities that
771   matched. For all other request methods, the server &MUST; respond with
772   a status of 412 (Precondition Failed).
775   See <xref target="weak.and.strong.validators"/> for rules on how to determine if two entities tags
776   match. The weak comparison function can only be used with GET or HEAD
777   requests.
780   If none of the entity tags match, then the server &MAY; perform the
781   requested method as if the If-None-Match header field did not exist,
782   but &MUST; also ignore any If-Modified-Since header field(s) in the
783   request. That is, if no entity tags match, then the server &MUST-NOT;
784   return a 304 (Not Modified) response.
787   If the request would, without the If-None-Match header field, result
788   in anything other than a 2xx or 304 status, then the If-None-Match
789   header &MUST; be ignored. (See <xref target=""/> for a discussion of
790   server behavior when both If-Modified-Since and If-None-Match appear
791   in the same request.)
794   The meaning of "If-None-Match: *" is that the method &MUST-NOT; be
795   performed if the representation selected by the origin server (or by
796   a cache, possibly using the Vary mechanism, see &header-vary;)
797   exists, and &SHOULD; be performed if the representation does not exist.
798   This feature is intended to be useful in preventing races between PUT
799   operations.
802   Examples:
804<figure><artwork type="example">
805    If-None-Match: "xyzzy"
806    If-None-Match: W/"xyzzy"
807    If-None-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
808    If-None-Match: W/"xyzzy", W/"r2d2xxxx", W/"c3piozzzz"
809    If-None-Match: *
812   The result of a request having both an If-None-Match header field and
813   either an If-Match or an If-Unmodified-Since header fields is
814   undefined by this specification.
818<section title="If-Unmodified-Since" anchor="header.if-unmodified-since">
819  <iref primary="true" item="If-Unmodified-Since header" x:for-anchor=""/>
820  <iref primary="true" item="Headers" subitem="If-Unmodified-Since" x:for-anchor=""/>
822   The If-Unmodified-Since request-header field is used with a method to
823   make it conditional. If the requested resource has not been modified
824   since the time specified in this field, the server &SHOULD; perform the
825   requested operation as if the If-Unmodified-Since header were not
826   present.
829   If the requested variant has been modified since the specified time,
830   the server &MUST-NOT; perform the requested operation, and &MUST; return
831   a 412 (Precondition Failed).
833<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Unmodified-Since"/>
834   If-Unmodified-Since = "If-Unmodified-Since" ":" HTTP-date
837   An example of the field is:
839<figure><artwork type="example">
840    If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT
843   If the request normally (i.e., without the If-Unmodified-Since
844   header) would result in anything other than a 2xx or 412 status, the
845   If-Unmodified-Since header &SHOULD; be ignored.
848   If the specified date is invalid, the header is ignored.
851   The result of a request having both an If-Unmodified-Since header
852   field and either an If-None-Match or an If-Modified-Since header
853   fields is undefined by this specification.
857<section title="Last-Modified" anchor="header.last-modified">
858  <iref primary="true" item="Last-Modified header" x:for-anchor=""/>
859  <iref primary="true" item="Headers" subitem="Last-Modified" x:for-anchor=""/>
861   The Last-Modified entity-header field indicates the date and time at
862   which the origin server believes the variant was last modified.
864<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Last-Modified"/>
865    Last-Modified  = "Last-Modified" ":" HTTP-date
868   An example of its use is
870<figure><artwork type="example">
871    Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT
874   The exact meaning of this header field depends on the implementation
875   of the origin server and the nature of the original resource. For
876   files, it may be just the file system last-modified time. For
877   entities with dynamically included parts, it may be the most recent
878   of the set of last-modify times for its component parts. For database
879   gateways, it may be the last-update time stamp of the record. For
880   virtual objects, it may be the last time the internal state changed.
883   An origin server &MUST-NOT; send a Last-Modified date which is later
884   than the server's time of message origination. In such cases, where
885   the resource's last modification would indicate some time in the
886   future, the server &MUST; replace that date with the message
887   origination date.
890   An origin server &SHOULD; obtain the Last-Modified value of the entity
891   as close as possible to the time that it generates the Date value of
892   its response. This allows a recipient to make an accurate assessment
893   of the entity's modification time, especially if the entity changes
894   near the time that the response is generated.
897   HTTP/1.1 servers &SHOULD; send Last-Modified whenever feasible.
903<section title="IANA Considerations" anchor="IANA.considerations">
905   TBD.
909<section title="Security Considerations" anchor="security.considerations">
911   No additional security considerations have been identified beyond
912   those applicable to HTTP in general &messaging;.
916<section title="Acknowledgments" anchor="ack">
922<reference anchor="Part1">
923   <front>
924      <title abbrev="HTTP/1.1">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</title>
925      <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
926         <organization abbrev="Day Software">Day Software</organization>
927         <address><email></email></address>
928      </author>
929      <author initials="J." surname="Gettys" fullname="Jim Gettys">
930         <organization>One Laptop per Child</organization>
931         <address><email></email></address>
932      </author>
933      <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
934         <organization abbrev="HP">Hewlett-Packard Company</organization>
935         <address><email></email></address>
936      </author>
937      <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
938         <organization abbrev="Microsoft">Microsoft Corporation</organization>
939         <address><email></email></address>
940      </author>
941      <author initials="L." surname="Masinter" fullname="Larry Masinter">
942         <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
943         <address><email></email></address>
944      </author>
945      <author initials="P." surname="Leach" fullname="Paul J. Leach">
946         <organization abbrev="Microsoft">Microsoft Corporation</organization>
947         <address><email></email></address>
948      </author>
949      <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
950         <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
951         <address><email></email></address>
952      </author>
953      <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
954         <organization abbrev="W3C">World Wide Web Consortium</organization>
955         <address><email></email></address>
956      </author>
957      <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
958         <organization abbrev="greenbytes">greenbytes GmbH</organization>
959         <address><email></email></address>
960      </author>
961      <date month="&ID-MONTH;" year="&ID-YEAR;"/>
962   </front>
963   <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"/>
964   <x:source href="p1-messaging.xml" basename="p1-messaging"/>
967<reference anchor="Part5">
968   <front>
969      <title abbrev="HTTP/1.1">HTTP/1.1, part 5: Range Requests and Partial Responses</title>
970      <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
971         <organization abbrev="Day Software">Day Software</organization>
972         <address><email></email></address>
973      </author>
974      <author initials="J." surname="Gettys" fullname="Jim Gettys">
975         <organization>One Laptop per Child</organization>
976         <address><email></email></address>
977      </author>
978      <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
979         <organization abbrev="HP">Hewlett-Packard Company</organization>
980         <address><email></email></address>
981      </author>
982      <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
983         <organization abbrev="Microsoft">Microsoft Corporation</organization>
984         <address><email></email></address>
985      </author>
986      <author initials="L." surname="Masinter" fullname="Larry Masinter">
987         <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
988         <address><email></email></address>
989      </author>
990      <author initials="P." surname="Leach" fullname="Paul J. Leach">
991         <organization abbrev="Microsoft">Microsoft Corporation</organization>
992         <address><email></email></address>
993      </author>
994      <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
995         <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
996         <address><email></email></address>
997      </author>
998      <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
999         <organization abbrev="W3C">World Wide Web Consortium</organization>
1000         <address><email></email></address>
1001      </author>
1002      <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1003         <organization abbrev="greenbytes">greenbytes GmbH</organization>
1004         <address><email></email></address>
1005      </author>
1006      <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1007   </front>
1008   <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p5-range-&ID-VERSION;"/>
1009   <x:source href="p5-range.xml" basename="p5-range"/>
1012<reference anchor="Part6">
1013   <front>
1014      <title abbrev="HTTP/1.1">HTTP/1.1, part 6: Caching</title>
1015      <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1016         <organization abbrev="Day Software">Day Software</organization>
1017         <address><email></email></address>
1018      </author>
1019      <author initials="J." surname="Gettys" fullname="Jim Gettys">
1020         <organization>One Laptop per Child</organization>
1021         <address><email></email></address>
1022      </author>
1023      <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1024         <organization abbrev="HP">Hewlett-Packard Company</organization>
1025         <address><email></email></address>
1026      </author>
1027      <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1028         <organization abbrev="Microsoft">Microsoft Corporation</organization>
1029         <address><email></email></address>
1030      </author>
1031      <author initials="L." surname="Masinter" fullname="Larry Masinter">
1032         <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1033         <address><email></email></address>
1034      </author>
1035      <author initials="P." surname="Leach" fullname="Paul J. Leach">
1036         <organization abbrev="Microsoft">Microsoft Corporation</organization>
1037         <address><email></email></address>
1038      </author>
1039      <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1040         <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1041         <address><email></email></address>
1042      </author>
1043      <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1044         <organization abbrev="W3C">World Wide Web Consortium</organization>
1045         <address><email></email></address>
1046      </author>
1047      <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1048         <organization abbrev="greenbytes">greenbytes GmbH</organization>
1049         <address><email></email></address>
1050      </author>
1051      <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1052   </front>
1053   <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-&ID-VERSION;"/>
1054   <x:source href="p6-cache.xml" basename="p6-cache"/>
1057<reference anchor="RFC2616">
1058   <front>
1059      <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
1060      <author initials="R." surname="Fielding" fullname="R. Fielding">
1061         <organization>University of California, Irvine</organization>
1062         <address><email></email></address>
1063      </author>
1064      <author initials="J." surname="Gettys" fullname="J. Gettys">
1065         <organization>W3C</organization>
1066         <address><email></email></address>
1067      </author>
1068      <author initials="J." surname="Mogul" fullname="J. Mogul">
1069         <organization>Compaq Computer Corporation</organization>
1070         <address><email></email></address>
1071      </author>
1072      <author initials="H." surname="Frystyk" fullname="H. Frystyk">
1073         <organization>MIT Laboratory for Computer Science</organization>
1074         <address><email></email></address>
1075      </author>
1076      <author initials="L." surname="Masinter" fullname="L. Masinter">
1077         <organization>Xerox Corporation</organization>
1078         <address><email></email></address>
1079      </author>
1080      <author initials="P." surname="Leach" fullname="P. Leach">
1081         <organization>Microsoft Corporation</organization>
1082         <address><email></email></address>
1083      </author>
1084      <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
1085         <organization>W3C</organization>
1086         <address><email></email></address>
1087      </author>
1088      <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1089         <organization abbrev="W3C">World Wide Web Consortium</organization>
1090         <address><email></email></address>
1091      </author>
1092      <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1093         <organization abbrev="greenbytes">greenbytes GmbH</organization>
1094         <address><email></email></address>
1095      </author>
1096      <date month="June" year="1999"/>
1097   </front>
1098   <seriesInfo name="RFC" value="2616"/>
1101<reference anchor="RFC2068">
1103<title abbrev="HTTP/1.1">Hypertext Transfer Protocol -- HTTP/1.1</title>
1104<author initials="R." surname="Fielding" fullname="Roy T. Fielding">
1105<organization>University of California, Irvine, Department of Information and Computer Science</organization>
1113<facsimile>+1 714 824 4056</facsimile>
1115<author initials="J." surname="Gettys" fullname="Jim Gettys">
1116<organization>MIT Laboratory for Computer Science</organization>
1119<street>545 Technology Square</street>
1124<facsimile>+1 617 258 8682</facsimile>
1126<author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1127<organization>Digital Equipment Corporation, Western Research Laboratory</organization>
1130<street>250 University Avenue</street>
1131<city>Palo Alto</city>
1136<author initials="H." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
1137<organization>MIT Laboratory for Computer Science</organization>
1140<street>545 Technology Square</street>
1145<facsimile>+1 617 258 8682</facsimile>
1147<author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1148<organization>MIT Laboratory for Computer Science</organization>
1151<street>545 Technology Square</street>
1156<facsimile>+1 617 258 8682</facsimile>
1158<date month="January" year="1997"/>
1160<t>The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. It is a generic, stateless, object-oriented protocol which can be used for many tasks, such as name servers and distributed object management systems, through extension of its request methods. A feature of HTTP is the typing and negotiation of data representation, allowing systems to be built independently of the data being transferred.</t>
1161<t>HTTP has been in use by the World-Wide Web global information initiative since 1990. This specification defines the protocol referred to as "HTTP/1.1".</t></abstract></front>
1162<seriesInfo name="RFC" value="2068"/>
Note: See TracBrowser for help on using the repository browser.