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

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

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

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