source: draft-ietf-httpbis/01/draft-ietf-httpbis-p4-conditional-01.xml

Last change on this file was 1500, checked in by julian.reschke@…, 11 years ago

fix mime types

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/xml
File size: 49.4 KB
1<?xml version="1.0" encoding="UTF-8"?>
3    This XML document is the output of clean-for-DTD.xslt; a tool that strips
4    extensions to RFC2629(bis) from documents for processing with xml2rfc.
6<?xml-stylesheet type='text/xsl' href='../myxml2rfc.xslt'?>
7<?rfc toc="yes" ?>
8<?rfc symrefs="yes" ?>
9<?rfc sortrefs="yes" ?>
10<?rfc compact="yes"?>
11<?rfc subcompact="no" ?>
12<?rfc linkmailto="no" ?>
13<?rfc editing="no" ?>
14<!DOCTYPE rfc
15  PUBLIC "" "rfc2629.dtd">
16<rfc obsoletes="2616" category="std" ipr="full3978" docName="draft-ietf-httpbis-p4-conditional-01">
19  <title abbrev="HTTP/1.1, Part 4">HTTP/1.1, part 4: Conditional Requests</title>
21  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
22    <organization abbrev="Day Software">Day Software</organization>
23    <address>
24      <postal>
25        <street>23 Corporate Plaza DR, Suite 280</street>
26        <city>Newport Beach</city>
27        <region>CA</region>
28        <code>92660</code>
29        <country>USA</country>
30      </postal>
31      <phone>+1-949-706-5300</phone>
32      <facsimile>+1-949-706-5305</facsimile>
33      <email></email>
34      <uri></uri>
35    </address>
36  </author>
38  <author initials="J." surname="Gettys" fullname="Jim Gettys">
39    <organization>One Laptop per Child</organization>
40    <address>
41      <postal>
42        <street>21 Oak Knoll Road</street>
43        <city>Carlisle</city>
44        <region>MA</region>
45        <code>01741</code>
46        <country>USA</country>
47      </postal>
48      <email></email>
49      <uri></uri>
50    </address>
51  </author>
53  <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
54    <organization abbrev="HP">Hewlett-Packard Company</organization>
55    <address>
56      <postal>
57        <street>HP Labs, Large Scale Systems Group</street>
58        <street>1501 Page Mill Road, MS 1177</street>
59        <city>Palo Alto</city>
60        <region>CA</region>
61        <code>94304</code>
62        <country>USA</country>
63      </postal>
64      <email></email>
65    </address>
66  </author>
68  <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
69    <organization abbrev="Microsoft">Microsoft Corporation</organization>
70    <address>
71      <postal>
72        <street>1 Microsoft Way</street>
73        <city>Redmond</city>
74        <region>WA</region>
75        <code>98052</code>
76        <country>USA</country>
77      </postal>
78      <email></email>
79    </address>
80  </author>
82  <author initials="L." surname="Masinter" fullname="Larry Masinter">
83    <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
84    <address>
85      <postal>
86        <street>345 Park Ave</street>
87        <city>San Jose</city>
88        <region>CA</region>
89        <code>95110</code>
90        <country>USA</country>
91      </postal>
92      <email></email>
93      <uri></uri>
94    </address>
95  </author>
97  <author initials="P." surname="Leach" fullname="Paul J. Leach">
98    <organization abbrev="Microsoft">Microsoft Corporation</organization>
99    <address>
100      <postal>
101        <street>1 Microsoft Way</street>
102        <city>Redmond</city>
103        <region>WA</region>
104        <code>98052</code>
105      </postal>
106      <email></email>
107    </address>
108  </author>
110  <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
111    <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
112    <address>
113      <postal>
114        <street>MIT Computer Science and Artificial Intelligence Laboratory</street>
115        <street>The Stata Center, Building 32</street>
116        <street>32 Vassar Street</street>
117        <city>Cambridge</city>
118        <region>MA</region>
119        <code>02139</code>
120        <country>USA</country>
121      </postal>
122      <email></email>
123      <uri></uri>
124    </address>
125  </author>
127  <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
128    <organization abbrev="W3C">World Wide Web Consortium</organization>
129    <address>
130      <postal>
131        <street>W3C / ERCIM</street>
132        <street>2004, rte des Lucioles</street>
133        <city>Sophia-Antipolis</city>
134        <region>AM</region>
135        <code>06902</code>
136        <country>France</country>
137      </postal>
138      <email></email>
139      <uri></uri>
140    </address>
141  </author>
143  <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
144    <organization abbrev="greenbytes">greenbytes GmbH</organization>
145    <address>
146      <postal>
147        <street>Hafenweg 16</street>
148        <city>Muenster</city><region>NW</region><code>48155</code>
149        <country>Germany</country>
150      </postal>
151      <phone>+49 251 2807760</phone>   
152      <facsimile>+49 251 2807761</facsimile>   
153      <email></email>       
154      <uri></uri>     
155    </address>
156  </author>
158  <date month="January" year="2008" day="12"/>
162   The Hypertext Transfer Protocol (HTTP) is an application-level
163   protocol for distributed, collaborative, hypermedia information
164   systems. HTTP has been in use by the World Wide Web global information
165   initiative since 1990. This document is Part 4 of the seven-part specification
166   that defines the protocol referred to as "HTTP/1.1" and, taken together,
167   obsoletes RFC 2616.  Part 4 defines request header fields for
168   indicating conditional requests and the rules for constructing responses
169   to those requests.
173<note title="Editorial Note (To be removed by RFC Editor)">
174  <t>
175    Discussion of this draft should take place on the HTTPBIS working group
176    mailing list ( The current issues list is
177    at <eref target=""/>
178    and related documents (including fancy diffs) can be found at
179    <eref target=""/>.
180  </t>
181  <t>
182    This draft incorporates those issue resolutions that were either
183    collected in the original RFC2616 errata list (<eref target=""/>),
184    or which were agreed upon on the mailing list between October 2006 and
185    November 2007 (as published in "draft-lafon-rfc2616bis-03").
186  </t>
190<section title="Introduction" anchor="introduction">
192   This document defines HTTP/1.1 response metadata for indicating potential
193   changes to payload content, including modification time stamps and opaque
194   entity-tags, and the HTTP conditional request mechanisms that allow
195   preconditions to be placed on a request method.  Conditional GET requests
196   allow for efficient cache updates.  Other conditional request methods are
197   used to protect against overwriting or misunderstanding the state of a
198   resource that has been changed unbeknownst to the requesting client.
201   This document is currently disorganized in order to minimize the changes
202   between drafts and enable reviewers to see the smaller errata changes.
203   The next draft will reorganize the sections to better reflect the content.
204   In particular, the sections on resource metadata will be discussed first
205   and then followed by each conditional request-header, concluding with a
206   definition of precedence and the expectation of ordering strong validator
207   checks before weak validator checks.  It is likely that more content from
208   <xref target="Part6"/> will migrate to this part, where appropriate.
209   The current mess reflects how widely dispersed these topics and associated
210   requirements had become in <xref target="RFC2616"/>.
213<section title="Requirements" anchor="intro.requirements">
215   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
216   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
217   document are to be interpreted as described in <xref target="RFC2119"/>.
220   An implementation is not compliant if it fails to satisfy one or more
221   of the MUST or REQUIRED level requirements for the protocols it
222   implements. An implementation that satisfies all the MUST or REQUIRED
223   level and all the SHOULD level requirements for its protocols is said
224   to be "unconditionally compliant"; one that satisfies all the MUST
225   level requirements but not all the SHOULD level requirements for its
226   protocols is said to be "conditionally compliant."
231<section title="Entity Tags" anchor="entity.tags">
233   Entity tags are used for comparing two or more entities from the same
234   requested resource. HTTP/1.1 uses entity tags in the ETag (<xref target="header.etag"/>),
235   If-Match (<xref target="header.if-match"/>), If-None-Match (<xref target="header.if-none-match"/>), and
236   If-Range (Section 5.3 of <xref target="Part5"/>) header fields. The definition of how they
237   are used and compared as cache validators is in <xref target="weak.and.strong.validators"/>. An
238   entity tag consists of an opaque quoted string, possibly prefixed by
239   a weakness indicator.
241<figure><iref primary="true" item="Grammar" subitem="entity-tag"/><iref primary="true" item="Grammar" subitem="weak"/><iref primary="true" item="Grammar" subitem="opaque-tag"/><artwork type="abnf2616"><![CDATA[
242  entity-tag = [ weak ] opaque-tag
243  weak       = "W/"
244  opaque-tag = quoted-string
247   A "strong entity tag" MAY be shared by two entities of a resource
248   only if they are equivalent by octet equality.
251   A "weak entity tag," indicated by the "W/" prefix, MAY be shared by
252   two entities of a resource only if the entities are equivalent and
253   could be substituted for each other with no significant change in
254   semantics. A weak entity tag can only be used for weak comparison.
257   An entity tag MUST be unique across all versions of all entities
258   associated with a particular resource. A given entity tag value MAY
259   be used for entities obtained by requests on different URIs. The use
260   of the same entity tag value in conjunction with entities obtained by
261   requests on different URIs does not imply the equivalence of those
262   entities.
266<section title="Status Code Definitions">
267<section title="304 Not Modified" anchor="status.304">
268  <iref primary="true" item="304 Not Modified (status code)"/>
269  <iref primary="true" item="Status Codes" subitem="304 Not Modified"/>
271   If the client has performed a conditional GET request and access is
272   allowed, but the document has not been modified, the server SHOULD
273   respond with this status code. The 304 response MUST NOT contain a
274   message-body, and thus is always terminated by the first empty line
275   after the header fields.
278   The response MUST include the following header fields:
279  <list style="symbols">
280    <t>Date, unless its omission is required by Section 8.3.1 of <xref target="Part1"/></t>
281  </list>
284   If a clockless origin server obeys these rules, and proxies and
285   clients add their own Date to any response received without one (as
286   already specified by <xref target="RFC2068"/>, Section 14.19), caches will operate
287   correctly.
288  <list style="symbols">
289    <t>ETag and/or Content-Location, if the header would have been sent
290        in a 200 response to the same request</t>
291    <t>Expires, Cache-Control, and/or Vary, if the field-value might
292        differ from that sent in any previous response for the same
293        variant</t>
294  </list>
297   If the conditional GET used a strong cache validator (see <xref target="weak.and.strong.validators"/>),
298   the response SHOULD NOT  include other entity-headers.
299   Otherwise (i.e., the conditional GET used a weak validator), the
300   response MUST NOT include other entity-headers; this prevents
301   inconsistencies between cached entity-bodies and updated headers.
304   If a 304 response indicates an entity not currently cached, then the
305   cache MUST disregard the response and repeat the request without the
306   conditional.
309   If a cache uses a received 304 response to update a cache entry, the
310   cache MUST update the entry to reflect any new field values given in
311   the response.
315<section title="412 Precondition Failed" anchor="status.412">
316  <iref primary="true" item="412 Precondition Failed (status code)"/>
317  <iref primary="true" item="Status Codes" subitem="412 Precondition Failed"/>
319   The precondition given in one or more of the request-header fields
320   evaluated to false when it was tested on the server. This response
321   code allows the client to place preconditions on the current resource
322   metainformation (header field data) and thus prevent the requested
323   method from being applied to a resource other than the one intended.
328<section title="Weak and Strong Validators" anchor="weak.and.strong.validators">
330   Since both origin servers and caches will compare two validators to
331   decide if they represent the same or different entities, one normally
332   would expect that if the entity (the entity-body or any entity-headers)
333   changes in any way, then the associated validator would
334   change as well. If this is true, then we call this validator a
335   "strong validator."
338   However, there might be cases when a server prefers to change the
339   validator only on semantically significant changes, and not when
340   insignificant aspects of the entity change. A validator that does not
341   always change when the resource changes is a "weak validator."
344   Entity tags are normally "strong validators," but the protocol
345   provides a mechanism to tag an entity tag as "weak." One can think of
346   a strong validator as one that changes whenever the bits of an entity
347   changes, while a weak value changes whenever the meaning of an entity
348   changes. Alternatively, one can think of a strong validator as part
349   of an identifier for a specific entity, while a weak validator is
350   part of an identifier for a set of semantically equivalent entities.
351  <list><t>
352      Note: One example of a strong validator is an integer that is
353      incremented in stable storage every time an entity is changed.
354    </t><t>
355      An entity's modification time, if represented with one-second
356      resolution, could be a weak validator, since it is possible that
357      the resource might be modified twice during a single second.
358    </t><t>
359      Support for weak validators is optional. However, weak validators
360      allow for more efficient caching of equivalent objects; for
361      example, a hit counter on a site is probably good enough if it is
362      updated every few days or weeks, and any value during that period
363      is likely "good enough" to be equivalent.
364    </t></list>
367   A "use" of a validator is either when a client generates a request
368   and includes the validator in a validating header field, or when a
369   server compares two validators.
372   Strong validators are usable in any context. Weak validators are only
373   usable in contexts that do not depend on exact equality of an entity.
374   For example, either kind is usable for a conditional GET of a full
375   entity. However, only a strong validator is usable for a sub-range
376   retrieval, since otherwise the client might end up with an internally
377   inconsistent entity.
380   Clients MAY issue simple (non-subrange) GET requests with either weak
381   validators or strong validators. Clients MUST NOT use weak validators
382   in other forms of request.
385   The only function that the HTTP/1.1 protocol defines on validators is
386   comparison. There are two validator comparison functions, depending
387   on whether the comparison context allows the use of weak validators
388   or not:
389  <list style="symbols">
390     <t>The strong comparison function: in order to be considered equal,
391        both validators MUST be identical in every way, and both MUST NOT
392        be weak.</t>
393     <t>The weak comparison function: in order to be considered equal,
394        both validators MUST be identical in every way, but either or
395        both of them MAY be tagged as "weak" without affecting the
396        result.</t>
397  </list>
400   An entity tag is strong unless it is explicitly tagged as weak.
401   <xref target="entity.tags"/> gives the syntax for entity tags.
404   A Last-Modified time, when used as a validator in a request, is
405   implicitly weak unless it is possible to deduce that it is strong,
406   using the following rules:
407  <list style="symbols">
408     <t>The validator is being compared by an origin server to the
409        actual current validator for the entity and,</t>
410     <t>That origin server reliably knows that the associated entity did
411        not change twice during the second covered by the presented
412        validator.</t>
413  </list>
416   or
417  <list style="symbols">
418     <t>The validator is about to be used by a client in an If-Modified-Since
419        or If-Unmodified-Since header, because the client
420        has a cache entry for the associated entity, and</t>
421     <t>That cache entry includes a Date value, which gives the time
422        when the origin server sent the original response, and</t>
423     <t>The presented Last-Modified time is at least 60 seconds before
424        the Date value.</t>
425  </list>
428   or
429  <list style="symbols">
430     <t>The validator is being compared by an intermediate cache to the
431        validator stored in its cache entry for the entity, and</t>
432     <t>That cache entry includes a Date value, which gives the time
433        when the origin server sent the original response, and</t>
434     <t>The presented Last-Modified time is at least 60 seconds before
435        the Date value.</t>
436  </list>
439   This method relies on the fact that if two different responses were
440   sent by the origin server during the same second, but both had the
441   same Last-Modified time, then at least one of those responses would
442   have a Date value equal to its Last-Modified time. The arbitrary 60-second
443   limit guards against the possibility that the Date and Last-Modified
444   values are generated from different clocks, or at somewhat
445   different times during the preparation of the response. An
446   implementation MAY use a value larger than 60 seconds, if it is
447   believed that 60 seconds is too short.
450   If a client wishes to perform a sub-range retrieval on a value for
451   which it has only a Last-Modified time and no opaque validator, it
452   MAY do this only if the Last-Modified time is strong in the sense
453   described here.
456   A cache or origin server receiving a conditional request, other than
457   a full-body GET request, MUST use the strong comparison function to
458   evaluate the condition.
461   These rules allow HTTP/1.1 caches and clients to safely perform sub-range
462   retrievals on values that have been obtained from HTTP/1.0
463   servers.
467<section title="Rules for When to Use Entity Tags and Last-Modified Dates" anchor="">
469   We adopt a set of rules and recommendations for origin servers,
470   clients, and caches regarding when various validator types ought to
471   be used, and for what purposes.
474   HTTP/1.1 origin servers:
475  <list style="symbols">
476     <t>SHOULD send an entity tag validator unless it is not feasible to
477        generate one.</t>
479     <t>MAY send a weak entity tag instead of a strong entity tag, if
480        performance considerations support the use of weak entity tags,
481        or if it is unfeasible to send a strong entity tag.</t>
483     <t>SHOULD send a Last-Modified value if it is feasible to send one,
484        unless the risk of a breakdown in semantic transparency that
485        could result from using this date in an If-Modified-Since header
486        would lead to serious problems.</t>
487  </list>
490   In other words, the preferred behavior for an HTTP/1.1 origin server
491   is to send both a strong entity tag and a Last-Modified value.
494   In order to be legal, a strong entity tag MUST change whenever the
495   associated entity value changes in any way. A weak entity tag SHOULD
496   change whenever the associated entity changes in a semantically
497   significant way.
498  <list><t>
499      Note: in order to provide semantically transparent caching, an
500      origin server must avoid reusing a specific strong entity tag
501      value for two different entities, or reusing a specific weak
502      entity tag value for two semantically different entities. Cache
503      entries might persist for arbitrarily long periods, regardless of
504      expiration times, so it might be inappropriate to expect that a
505      cache will never again attempt to validate an entry using a
506      validator that it obtained at some point in the past.
507  </t></list>
510   HTTP/1.1 clients:
511  <list style="symbols">
512     <t>If an entity tag has been provided by the origin server, MUST
513        use that entity tag in any cache-conditional request (using If-Match
514        or If-None-Match).</t>
516     <t>If only a Last-Modified value has been provided by the origin
517        server, SHOULD use that value in non-subrange cache-conditional
518        requests (using If-Modified-Since).</t>
520     <t>If only a Last-Modified value has been provided by an HTTP/1.0
521        origin server, MAY use that value in subrange cache-conditional
522        requests (using If-Unmodified-Since:). The user agent SHOULD
523        provide a way to disable this, in case of difficulty.</t>
525     <t>If both an entity tag and a Last-Modified value have been
526        provided by the origin server, SHOULD use both validators in
527        cache-conditional requests. This allows both HTTP/1.0 and
528        HTTP/1.1 caches to respond appropriately.</t>
529  </list>
532   An HTTP/1.1 origin server, upon receiving a conditional request that
533   includes both a Last-Modified date (e.g., in an If-Modified-Since or
534   If-Unmodified-Since header field) and one or more entity tags (e.g.,
535   in an If-Match, If-None-Match, or If-Range header field) as cache
536   validators, MUST NOT return a response status of 304 (Not Modified)
537   unless doing so is consistent with all of the conditional header
538   fields in the request.
541   An HTTP/1.1 caching proxy, upon receiving a conditional request that
542   includes both a Last-Modified date and one or more entity tags as
543   cache validators, MUST NOT return a locally cached response to the
544   client unless that cached response is consistent with all of the
545   conditional header fields in the request.
546  <list><t>
547      Note: The general principle behind these rules is that HTTP/1.1
548      servers and clients should transmit as much non-redundant
549      information as is available in their responses and requests.
550      HTTP/1.1 systems receiving this information will make the most
551      conservative assumptions about the validators they receive.
552  </t><t>
553      HTTP/1.0 clients and caches will ignore entity tags. Generally,
554      last-modified values received or used by these systems will
555      support transparent and efficient caching, and so HTTP/1.1 origin
556      servers should provide Last-Modified values. In those rare cases
557      where the use of a Last-Modified value as a validator by an
558      HTTP/1.0 system could result in a serious problem, then HTTP/1.1
559      origin servers should not provide one.
560  </t></list>
564<section title="Header Field Definitions" anchor="header.fields">
566   This section defines the syntax and semantics of HTTP/1.1 header fields
567   related to conditional requests.
570   For entity-header fields, both sender and recipient refer to either the
571   client or the server, depending on who sends and who receives the entity.
574<section title="ETag" anchor="header.etag">
575  <iref primary="true" item="ETag header"/>
576  <iref primary="true" item="Headers" subitem="ETag"/>
578   The ETag response-header field provides the current value of the
579   entity tag for the requested variant. The headers used with entity
580   tags are described in Sections <xref target="header.if-match" format="counter"/>
581   and <xref target="header.if-none-match" format="counter"/> of this document,
582   and in Section 5.3 of <xref target="Part5"/>. The entity tag
583   MAY be used for comparison with other entities from the same resource
584   (see <xref target="weak.and.strong.validators"/>).
586<figure><iref primary="true" item="Grammar" subitem="ETag"/><artwork type="abnf2616"><![CDATA[
587  ETag = "ETag" ":" entity-tag
590   Examples:
592<artwork type="example"><![CDATA[
593   ETag: "xyzzy"
594   ETag: W/"xyzzy"
595   ETag: ""
599<section title="If-Match" anchor="header.if-match">
600  <iref primary="true" item="If-Match header"/>
601  <iref primary="true" item="Headers" subitem="If-Match"/>
603   The If-Match request-header field is used with a method to make it
604   conditional. A client that has one or more entities previously
605   obtained from the resource can verify that one of those entities is
606   current by including a list of their associated entity tags in the
607   If-Match header field. Entity tags are defined in <xref target="entity.tags"/>. The
608   purpose of this feature is to allow efficient updates of cached
609   information with a minimum amount of transaction overhead. It is also
610   used, on updating requests, to prevent inadvertent modification of
611   the wrong version of a resource. As a special case, the value "*"
612   matches any current entity of the resource.
614<figure><iref primary="true" item="Grammar" subitem="If-Match"/><artwork type="abnf2616"><![CDATA[
615  If-Match = "If-Match" ":" ( "*" | 1#entity-tag )
618   If any of the entity tags match the entity tag of the entity that
619   would have been returned in the response to a similar GET request
620   (without the If-Match header) on that resource, or if "*" is given
621   and any current entity exists for that resource, then the server MAY
622   perform the requested method as if the If-Match header field did not
623   exist.
626   A server MUST use the strong comparison function (see <xref target="weak.and.strong.validators"/>)
627   to compare the entity tags in If-Match.
630   If none of the entity tags match, or if "*" is given and no current
631   entity exists, the server MUST NOT perform the requested method, and
632   MUST return a 412 (Precondition Failed) response. This behavior is
633   most useful when the client wants to prevent an updating method, such
634   as PUT, from modifying a resource that has changed since the client
635   last retrieved it.
638   If the request would, without the If-Match header field, result in
639   anything other than a 2xx or 412 status, then the If-Match header
640   MUST be ignored.
643   The meaning of "If-Match: *" is that the method SHOULD be performed
644   if the representation selected by the origin server (or by a cache,
645   possibly using the Vary mechanism, see Section 15.5 of <xref target="Part6"/>) exists, and
646   MUST NOT be performed if the representation does not exist.
649   A request intended to update a resource (e.g., a PUT) MAY include an
650   If-Match header field to signal that the request method MUST NOT be
651   applied if the entity corresponding to the If-Match value (a single
652   entity tag) is no longer a representation of that resource. This
653   allows the user to indicate that they do not wish the request to be
654   successful if the resource has been changed without their knowledge.
655   Examples:
657<figure><artwork type="example"><![CDATA[
658    If-Match: "xyzzy"
659    If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
660    If-Match: *
663   The result of a request having both an If-Match header field and
664   either an If-None-Match or an If-Modified-Since header fields is
665   undefined by this specification.
669<section title="If-Modified-Since" anchor="header.if-modified-since">
670  <iref primary="true" item="If-Modified-Since header"/>
671  <iref primary="true" item="Headers" subitem="If-Modified-Since"/>
673   The If-Modified-Since request-header field is used with a method to
674   make it conditional: if the requested variant has not been modified
675   since the time specified in this field, an entity will not be
676   returned from the server; instead, a 304 (Not Modified) response will
677   be returned without any message-body.
679<figure><iref primary="true" item="Grammar" subitem="If-Modified-Since"/><artwork type="abnf2616"><![CDATA[
680  If-Modified-Since = "If-Modified-Since" ":" HTTP-date
683   An example of the field is:
685<figure><artwork type="example"><![CDATA[
686    If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
689   A GET method with an If-Modified-Since header and no Range header
690   requests that the identified entity be transferred only if it has
691   been modified since the date given by the If-Modified-Since header.
692   The algorithm for determining this includes the following cases:
693  <list style="numbers">
694      <t>If the request would normally result in anything other than a
695         200 (OK) status, or if the passed If-Modified-Since date is
696         invalid, the response is exactly the same as for a normal GET.
697         A date which is later than the server's current time is
698         invalid.</t>
700      <t>If the variant has been modified since the If-Modified-Since
701         date, the response is exactly the same as for a normal GET.</t>
703      <t>If the variant has not been modified since a valid If-Modified-Since
704         date, the server SHOULD return a 304 (Not
705         Modified) response.</t>
706  </list>
709   The purpose of this feature is to allow efficient updates of cached
710   information with a minimum amount of transaction overhead.
711  <list><t>
712      Note: The Range request-header field modifies the meaning of If-Modified-Since;
713      see Section 5.4 of <xref target="Part5"/> for full details.
714    </t><t>
715      Note: If-Modified-Since times are interpreted by the server, whose
716      clock might not be synchronized with the client.
717    </t><t>
718      Note: When handling an If-Modified-Since header field, some
719      servers will use an exact date comparison function, rather than a
720      less-than function, for deciding whether to send a 304 (Not
721      Modified) response. To get best results when sending an If-Modified-Since
722      header field for cache validation, clients are
723      advised to use the exact date string received in a previous Last-Modified
724      header field whenever possible.
725    </t><t>
726      Note: If a client uses an arbitrary date in the If-Modified-Since
727      header instead of a date taken from the Last-Modified header for
728      the same request, the client should be aware of the fact that this
729      date is interpreted in the server's understanding of time. The
730      client should consider unsynchronized clocks and rounding problems
731      due to the different encodings of time between the client and
732      server. This includes the possibility of race conditions if the
733      document has changed between the time it was first requested and
734      the If-Modified-Since date of a subsequent request, and the
735      possibility of clock-skew-related problems if the If-Modified-Since
736      date is derived from the client's clock without correction
737      to the server's clock. Corrections for different time bases
738      between client and server are at best approximate due to network
739      latency.
740    </t>
741  </list>
744   The result of a request having both an If-Modified-Since header field
745   and either an If-Match or an If-Unmodified-Since header fields is
746   undefined by this specification.
750<section title="If-None-Match" anchor="header.if-none-match">
751  <iref primary="true" item="If-None-Match header"/>
752  <iref primary="true" item="Headers" subitem="If-None-Match"/>
754   The If-None-Match request-header field is used with a method to make
755   it conditional. A client that has one or more entities previously
756   obtained from the resource can verify that none of those entities is
757   current by including a list of their associated entity tags in the
758   If-None-Match header field. The purpose of this feature is to allow
759   efficient updates of cached information with a minimum amount of
760   transaction overhead. It is also used to prevent a method (e.g. PUT)
761   from inadvertently modifying an existing resource when the client
762   believes that the resource does not exist.
765   As a special case, the value "*" matches any current entity of the
766   resource.
768<figure><iref primary="true" item="Grammar" subitem="If-None-Match"/><artwork type="abnf2616"><![CDATA[
769  If-None-Match = "If-None-Match" ":" ( "*" | 1#entity-tag )
772   If any of the entity tags match the entity tag of the entity that
773   would have been returned in the response to a similar GET request
774   (without the If-None-Match header) on that resource, or if "*" is
775   given and any current entity exists for that resource, then the
776   server MUST NOT perform the requested method, unless required to do
777   so because the resource's modification date fails to match that
778   supplied in an If-Modified-Since header field in the request.
779   Instead, if the request method was GET or HEAD, the server SHOULD
780   respond with a 304 (Not Modified) response, including the cache-related
781   header fields (particularly ETag) of one of the entities that
782   matched. For all other request methods, the server MUST respond with
783   a status of 412 (Precondition Failed).
786   See <xref target="weak.and.strong.validators"/> for rules on how to determine if two entities tags
787   match. The weak comparison function can only be used with GET or HEAD
788   requests.
791   If none of the entity tags match, then the server MAY perform the
792   requested method as if the If-None-Match header field did not exist,
793   but MUST also ignore any If-Modified-Since header field(s) in the
794   request. That is, if no entity tags match, then the server MUST NOT
795   return a 304 (Not Modified) response.
798   If the request would, without the If-None-Match header field, result
799   in anything other than a 2xx or 304 status, then the If-None-Match
800   header MUST be ignored. (See <xref target=""/> for a discussion of
801   server behavior when both If-Modified-Since and If-None-Match appear
802   in the same request.)
805   The meaning of "If-None-Match: *" is that the method MUST NOT be
806   performed if the representation selected by the origin server (or by
807   a cache, possibly using the Vary mechanism, see Section 15.5 of <xref target="Part6"/>)
808   exists, and SHOULD be performed if the representation does not exist.
809   This feature is intended to be useful in preventing races between PUT
810   operations.
813   Examples:
815<figure><artwork type="example"><![CDATA[
816    If-None-Match: "xyzzy"
817    If-None-Match: W/"xyzzy"
818    If-None-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
819    If-None-Match: W/"xyzzy", W/"r2d2xxxx", W/"c3piozzzz"
820    If-None-Match: *
823   The result of a request having both an If-None-Match header field and
824   either an If-Match or an If-Unmodified-Since header fields is
825   undefined by this specification.
829<section title="If-Unmodified-Since" anchor="header.if-unmodified-since">
830  <iref primary="true" item="If-Unmodified-Since header"/>
831  <iref primary="true" item="Headers" subitem="If-Unmodified-Since"/>
833   The If-Unmodified-Since request-header field is used with a method to
834   make it conditional. If the requested resource has not been modified
835   since the time specified in this field, the server SHOULD perform the
836   requested operation as if the If-Unmodified-Since header were not
837   present.
840   If the requested variant has been modified since the specified time,
841   the server MUST NOT perform the requested operation, and MUST return
842   a 412 (Precondition Failed).
844<figure><iref primary="true" item="Grammar" subitem="If-Unmodified-Since"/><artwork type="abnf2616"><![CDATA[
845  If-Unmodified-Since = "If-Unmodified-Since" ":" HTTP-date
848   An example of the field is:
850<figure><artwork type="example"><![CDATA[
851    If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT
854   If the request normally (i.e., without the If-Unmodified-Since
855   header) would result in anything other than a 2xx or 412 status, the
856   If-Unmodified-Since header SHOULD be ignored.
859   If the specified date is invalid, the header is ignored.
862   The result of a request having both an If-Unmodified-Since header
863   field and either an If-None-Match or an If-Modified-Since header
864   fields is undefined by this specification.
868<section title="Last-Modified" anchor="header.last-modified">
869  <iref primary="true" item="Last-Modified header"/>
870  <iref primary="true" item="Headers" subitem="Last-Modified"/>
872   The Last-Modified entity-header field indicates the date and time at
873   which the origin server believes the variant was last modified.
875<figure><iref primary="true" item="Grammar" subitem="Last-Modified"/><artwork type="abnf2616"><![CDATA[
876  Last-Modified  = "Last-Modified" ":" HTTP-date
879   An example of its use is
881<figure><artwork type="example"><![CDATA[
882    Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT
885   The exact meaning of this header field depends on the implementation
886   of the origin server and the nature of the original resource. For
887   files, it may be just the file system last-modified time. For
888   entities with dynamically included parts, it may be the most recent
889   of the set of last-modify times for its component parts. For database
890   gateways, it may be the last-update time stamp of the record. For
891   virtual objects, it may be the last time the internal state changed.
894   An origin server MUST NOT send a Last-Modified date which is later
895   than the server's time of message origination. In such cases, where
896   the resource's last modification would indicate some time in the
897   future, the server MUST replace that date with the message
898   origination date.
901   An origin server SHOULD obtain the Last-Modified value of the entity
902   as close as possible to the time that it generates the Date value of
903   its response. This allows a recipient to make an accurate assessment
904   of the entity's modification time, especially if the entity changes
905   near the time that the response is generated.
908   HTTP/1.1 servers SHOULD send Last-Modified whenever feasible.
914<section title="IANA Considerations" anchor="IANA.considerations">
916   TBD.
920<section title="Security Considerations" anchor="security.considerations">
922   No additional security considerations have been identified beyond
923   those applicable to HTTP in general <xref target="Part1"/>.
927<section title="Acknowledgments" anchor="ack">
932<references title="Normative References">
934<reference anchor="Part1">
935  <front>
936    <title abbrev="HTTP/1.1">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</title>
937    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
938      <organization abbrev="Day Software">Day Software</organization>
939      <address><email></email></address>
940    </author>
941    <author initials="J." surname="Gettys" fullname="Jim Gettys">
942      <organization>One Laptop per Child</organization>
943      <address><email></email></address>
944    </author>
945    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
946      <organization abbrev="HP">Hewlett-Packard Company</organization>
947      <address><email></email></address>
948    </author>
949    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
950      <organization abbrev="Microsoft">Microsoft Corporation</organization>
951      <address><email></email></address>
952    </author>
953    <author initials="L." surname="Masinter" fullname="Larry Masinter">
954      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
955      <address><email></email></address>
956    </author>
957    <author initials="P." surname="Leach" fullname="Paul J. Leach">
958      <organization abbrev="Microsoft">Microsoft Corporation</organization>
959      <address><email></email></address>
960    </author>
961    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
962      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
963      <address><email></email></address>
964    </author>
965    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
966      <organization abbrev="W3C">World Wide Web Consortium</organization>
967      <address><email></email></address>
968    </author>
969    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
970      <organization abbrev="greenbytes">greenbytes GmbH</organization>
971      <address><email></email></address>
972    </author>
973    <date month="January" year="2008"/>
974  </front>
975  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-01"/>
979<reference anchor="Part5">
980  <front>
981    <title abbrev="HTTP/1.1">HTTP/1.1, part 5: Range Requests and Partial Responses</title>
982    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
983      <organization abbrev="Day Software">Day Software</organization>
984      <address><email></email></address>
985    </author>
986    <author initials="J." surname="Gettys" fullname="Jim Gettys">
987      <organization>One Laptop per Child</organization>
988      <address><email></email></address>
989    </author>
990    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
991      <organization abbrev="HP">Hewlett-Packard Company</organization>
992      <address><email></email></address>
993    </author>
994    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
995      <organization abbrev="Microsoft">Microsoft Corporation</organization>
996      <address><email></email></address>
997    </author>
998    <author initials="L." surname="Masinter" fullname="Larry Masinter">
999      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1000      <address><email></email></address>
1001    </author>
1002    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1003      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1004      <address><email></email></address>
1005    </author>
1006    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1007      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1008      <address><email></email></address>
1009    </author>
1010    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1011      <organization abbrev="W3C">World Wide Web Consortium</organization>
1012      <address><email></email></address>
1013    </author>
1014    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1015      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1016      <address><email></email></address>
1017    </author>
1018    <date month="January" year="2008"/>
1019  </front>
1020  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p5-range-01"/>
1024<reference anchor="Part6">
1025  <front>
1026    <title abbrev="HTTP/1.1">HTTP/1.1, part 6: Caching</title>
1027    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1028      <organization abbrev="Day Software">Day Software</organization>
1029      <address><email></email></address>
1030    </author>
1031    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1032      <organization>One Laptop per Child</organization>
1033      <address><email></email></address>
1034    </author>
1035    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1036      <organization abbrev="HP">Hewlett-Packard Company</organization>
1037      <address><email></email></address>
1038    </author>
1039    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1040      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1041      <address><email></email></address>
1042    </author>
1043    <author initials="L." surname="Masinter" fullname="Larry Masinter">
1044      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1045      <address><email></email></address>
1046    </author>
1047    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1048      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1049      <address><email></email></address>
1050    </author>
1051    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1052      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1053      <address><email></email></address>
1054    </author>
1055    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1056      <organization abbrev="W3C">World Wide Web Consortium</organization>
1057      <address><email></email></address>
1058    </author>
1059    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1060      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1061      <address><email></email></address>
1062    </author>
1063    <date month="January" year="2008"/>
1064  </front>
1065  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-01"/>
1069<reference anchor="RFC2119">
1070  <front>
1071    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
1072    <author initials="S." surname="Bradner" fullname="Scott Bradner">
1073      <organization>Harvard University</organization>
1074      <address><email></email></address>
1075    </author>
1076    <date month="March" year="1997"/>
1077  </front>
1078  <seriesInfo name="BCP" value="14"/>
1079  <seriesInfo name="RFC" value="2119"/>
1084<references title="Informative References">
1086<reference anchor="RFC2068">
1087  <front>
1088    <title abbrev="HTTP/1.1">Hypertext Transfer Protocol -- HTTP/1.1</title>
1089    <author initials="R." surname="Fielding" fullname="Roy T. Fielding">
1090      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
1091      <address><email></email></address>
1092    </author>
1093    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1094      <organization>MIT Laboratory for Computer Science</organization>
1095      <address><email></email></address>
1096    </author>
1097    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1098      <organization>Digital Equipment Corporation, Western Research Laboratory</organization>
1099      <address><email></email></address>
1100    </author>
1101    <author initials="H." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
1102      <organization>MIT Laboratory for Computer Science</organization>
1103      <address><email></email></address>
1104    </author>
1105    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1106      <organization>MIT Laboratory for Computer Science</organization>
1107      <address><email></email></address>
1108    </author>
1109    <date month="January" year="1997"/>
1110  </front>
1111  <seriesInfo name="RFC" value="2068"/>
1114<reference anchor="RFC2616">
1115  <front>
1116    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
1117    <author initials="R." surname="Fielding" fullname="R. Fielding">
1118      <organization>University of California, Irvine</organization>
1119      <address><email></email></address>
1120    </author>
1121    <author initials="J." surname="Gettys" fullname="J. Gettys">
1122      <organization>W3C</organization>
1123      <address><email></email></address>
1124    </author>
1125    <author initials="J." surname="Mogul" fullname="J. Mogul">
1126      <organization>Compaq Computer Corporation</organization>
1127      <address><email></email></address>
1128    </author>
1129    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
1130      <organization>MIT Laboratory for Computer Science</organization>
1131      <address><email></email></address>
1132    </author>
1133    <author initials="L." surname="Masinter" fullname="L. Masinter">
1134      <organization>Xerox Corporation</organization>
1135      <address><email></email></address>
1136    </author>
1137    <author initials="P." surname="Leach" fullname="P. Leach">
1138      <organization>Microsoft Corporation</organization>
1139      <address><email></email></address>
1140    </author>
1141    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
1142      <organization>W3C</organization>
1143      <address><email></email></address>
1144    </author>
1145    <date month="June" year="1999"/>
1146  </front>
1147  <seriesInfo name="RFC" value="2616"/>
1152<section title="Compatibility with Previous Versions" anchor="compatibility">
1154<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
1159<section title="Change Log (to be removed by RFC Editor before publication)">
1161<section title="Since RFC2616">
1163  Extracted relevant partitions from <xref target="RFC2616"/>.
1167<section title="Since draft-ietf-httpbis-p4-conditional-00">
1169  Closed issues:
1170  <list style="symbols">
1171    <t>
1172      <eref target=""/>:
1173      "Normative and Informative references"
1174    </t>
1175  </list>
1178  Other changes:
1179  <list style="symbols">
1180    <t>
1181      Move definitions of 304 and 412 condition codes from Part2.
1182    </t>
1183  </list>
Note: See TracBrowser for help on using the repository browser.