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

Last change on this file since 2222 was 2218, checked in by julian.reschke@…, 7 years ago

bump up document dates, update to latest version of rfc2629.xslt

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/xml
File size: 67.5 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<?xml-stylesheet type='text/xsl' href='../myxml2rfc.xslt'?>
3<!DOCTYPE rfc [
4  <!ENTITY MAY "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MAY</bcp14>">
5  <!ENTITY MUST "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST</bcp14>">
6  <!ENTITY MUST-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST NOT</bcp14>">
7  <!ENTITY OPTIONAL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>OPTIONAL</bcp14>">
8  <!ENTITY RECOMMENDED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>RECOMMENDED</bcp14>">
9  <!ENTITY REQUIRED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>REQUIRED</bcp14>">
10  <!ENTITY SHALL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL</bcp14>">
11  <!ENTITY SHALL-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL NOT</bcp14>">
12  <!ENTITY SHOULD "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD</bcp14>">
13  <!ENTITY SHOULD-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD NOT</bcp14>">
14  <!ENTITY ID-VERSION "latest">
15  <!ENTITY ID-MONTH "April">
16  <!ENTITY ID-YEAR "2013">
17  <!ENTITY Note "<x:h xmlns:x='http://purl.org/net/xml2rfc/ext'>Note:</x:h>">
18  <!ENTITY architecture               "<xref target='Part1' x:rel='#architecture' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
19  <!ENTITY conformance                "<xref target='Part1' x:rel='#conformance' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
20  <!ENTITY notation                   "<xref target='Part1' x:rel='#notation' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
21  <!ENTITY abnf-extension             "<xref target='Part1' x:rel='#abnf.extension' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
22  <!ENTITY acks                       "<xref target='Part1' x:rel='#acks' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
23  <!ENTITY whitespace                 "<xref target='Part1' x:rel='#whitespace' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
24  <!ENTITY field-components           "<xref target='Part1' x:rel='#field.components' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
25  <!ENTITY header-date                "<xref target='Part2' x:rel='#header.date' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
26  <!ENTITY representation             "<xref target='Part2' x:rel='#representations' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
27  <!ENTITY messaging                  "<xref target='Part1' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
28  <!ENTITY semantics                  "<xref target='Part2' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
29  <!ENTITY caching                    "<xref target='Part6' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
30  <!ENTITY freshening-responses       "<xref target='Part6' x:rel='#freshening.responses' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
31  <!ENTITY header-accept-encoding     "<xref target='Part2' x:rel='#header.accept-encoding' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
32  <!ENTITY header-if-range            "<xref target='Part5' x:rel='#header.if-range' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
33  <!ENTITY header-range               "<xref target='Part5' x:rel='#header.range' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
34  <!ENTITY header-vary                "<xref target='Part2' x:rel='#header.vary' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
35  <!ENTITY http-date                  "<xref target='Part2' x:rel='#http.date' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
36  <!ENTITY transfer-codings           "<xref target='Part1' x:rel='#transfer.codings' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
37  <!ENTITY content-negotiation        "<xref target='Part2' x:rel='#content.negotiation' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
38]>
39<?rfc toc="yes" ?>
40<?rfc symrefs="yes" ?>
41<?rfc sortrefs="yes" ?>
42<?rfc compact="yes"?>
43<?rfc subcompact="no" ?>
44<?rfc linkmailto="no" ?>
45<?rfc editing="no" ?>
46<?rfc comments="yes"?>
47<?rfc inline="yes"?>
48<?rfc rfcedstyle="yes"?>
49<?rfc-ext allow-markup-in-artwork="yes" ?>
50<?rfc-ext include-references-in-index="yes" ?>
51<rfc obsoletes="2616" category="std" x:maturity-level="proposed"
52     ipr="pre5378Trust200902" docName="draft-ietf-httpbis-p4-conditional-&ID-VERSION;"
53     xmlns:x='http://purl.org/net/xml2rfc/ext'>
54<x:link rel="prev" basename="p2-semantics"/>
55<x:link rel="next" basename="p5-range"/>
56<x:feedback template="mailto:ietf-http-wg@w3.org?subject={docname},%20%22{section}%22&amp;body=&lt;{ref}&gt;:"/>
57<front>
58
59  <title abbrev="HTTP/1.1 Conditional Requests">Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests</title>
60
61  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
62    <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
63    <address>
64      <postal>
65        <street>345 Park Ave</street>
66        <city>San Jose</city>
67        <region>CA</region>
68        <code>95110</code>
69        <country>USA</country>
70      </postal>
71      <email>fielding@gbiv.com</email>
72      <uri>http://roy.gbiv.com/</uri>
73    </address>
74  </author>
75
76  <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
77    <organization abbrev="greenbytes">greenbytes GmbH</organization>
78    <address>
79      <postal>
80        <street>Hafenweg 16</street>
81        <city>Muenster</city><region>NW</region><code>48155</code>
82        <country>Germany</country>
83      </postal>
84      <email>julian.reschke@greenbytes.de</email>
85      <uri>http://greenbytes.de/tech/webdav/</uri>
86    </address>
87  </author>
88
89  <date month="&ID-MONTH;" year="&ID-YEAR;"/>
90  <workgroup>HTTPbis Working Group</workgroup>
91
92<abstract>
93<t>
94   The Hypertext Transfer Protocol (HTTP) is an application-level protocol for
95   distributed, collaborative, hypertext information systems. This document
96   defines HTTP/1.1 conditional requests, including metadata header fields
97   for indicating state changes, request header fields for making
98   preconditions on such state, and rules for constructing the responses to a
99   conditional request when one or more preconditions evaluate to false.
100</t>
101</abstract>
102
103<note title="Editorial Note (To be removed by RFC Editor)">
104  <t>
105    Discussion of this draft takes place on the HTTPBIS working group
106    mailing list (ietf-http-wg@w3.org), which is archived at
107    <eref target="http://lists.w3.org/Archives/Public/ietf-http-wg/"/>.
108  </t>
109  <t>
110    The current issues list is at
111    <eref target="http://tools.ietf.org/wg/httpbis/trac/report/3"/> and related
112    documents (including fancy diffs) can be found at
113    <eref target="http://tools.ietf.org/wg/httpbis/"/>.
114  </t>
115  <t>
116    The changes in this draft are summarized in <xref target="changes.since.22"/>.
117  </t>
118</note>
119</front>
120
121<middle>
122<section title="Introduction" anchor="introduction">
123<t>
124   Conditional requests are HTTP requests <xref target="Part2"/> that include
125   one or more header fields indicating a precondition to be tested before
126   applying the method semantics to the target resource.
127   This document defines the HTTP/1.1 conditional request mechanisms in terms
128   of the architecture, syntax notation, and conformance criteria defined in
129   <xref target="Part1"/>.
130</t>
131<t>
132   Conditional GET requests are the most efficient mechanism for HTTP
133   cache updates &caching;.  Conditionals can also be
134   applied to state-changing methods, such as PUT and DELETE, to prevent
135   the "lost update" problem: one client accidentally overwriting
136   the work of another client that has been acting in parallel.
137</t>
138<t><iref primary="true" item="selected representation"/>
139   Conditional request preconditions are based on the state of the target
140   resource as a whole (its current value set) or the state as observed
141   in a previously obtained representation (one value in that set).
142   A resource might have multiple current representations, each with its
143   own observable state.  The conditional request mechanisms assume that
144   the mapping of requests to a "selected representation" (&representation;)
145   will be consistent over time if the server intends to take advantage of
146   conditionals. Regardless, if the mapping is inconsistent and the server is
147   unable to select the appropriate representation, then no harm will result
148   when the precondition evaluates to false.
149</t>
150<t>
151   The conditional request preconditions defined by this specification are
152   evaluated by comparing the validators provided in the conditional request
153   header fields to the current validators for the selected representation
154   in the order defined by <xref target="precedence"/>.
155</t>
156
157<section title="Conformance and Error Handling" anchor="conformance">
158<t>
159   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
160   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
161   document are to be interpreted as described in <xref target="RFC2119"/>.
162</t>
163<t>
164   Conformance criteria and considerations regarding error handling
165   are defined in &conformance;.
166</t>
167</section>
168
169<section title="Syntax Notation" anchor="notation">
170<t>
171   This specification uses the Augmented Backus-Naur Form (ABNF) notation
172   of <xref target="RFC5234"/> with the list rule extension defined in
173   &notation;. <xref target="imported.abnf"/> describes rules imported from
174   other documents. <xref target="collected.abnf"/> shows the collected ABNF
175   with the list rule expanded.
176</t>
177</section>
178</section>
179
180<section title="Validators" anchor="validators">
181   <iref primary="true" item="metadata"/>
182   <iref primary="true" item="validator"/>
183<t>
184   This specification defines two forms of metadata that are commonly used
185   to observe resource state and test for preconditions: modification dates
186   (<xref target="header.last-modified"/>) and opaque entity tags
187   (<xref target="header.etag"/>).  Additional metadata that reflects resource state
188   has been defined by various extensions of HTTP, such as WebDAV
189   <xref target="RFC4918"/>, that are beyond the scope of this specification.
190   A resource metadata value is referred to as a "<x:dfn>validator</x:dfn>"
191   when it is used within a precondition.
192</t>
193
194<section title="Weak versus Strong" anchor="weak.and.strong.validators">
195   <iref primary="true" item="validator" subitem="weak"/>
196   <iref primary="true" item="validator" subitem="strong"/>
197<t>
198   Validators come in two flavors: strong or weak.  Weak validators are easy
199   to generate but are far less useful for comparisons.  Strong validators
200   are ideal for comparisons but can be very difficult (and occasionally
201   impossible) to generate efficiently.  Rather than impose that all forms
202   of resource adhere to the same strength of validator, HTTP exposes the
203   type of validator in use and imposes restrictions on when weak validators
204   can be used as preconditions.
205</t>
206<t>
207   A "strong validator" is representation metadata that changes value whenever
208   a change occurs to the representation data that would be observable in the
209   payload body of a <x:ref>200 (OK)</x:ref> response to GET.
210</t>
211<t>   
212   A strong validator might change for other reasons, such as when a
213   semantically significant part of the representation metadata is changed
214   (e.g., <x:ref>Content-Type</x:ref>), but it is in the best interests of the
215   origin server to only change the value when it is necessary to invalidate
216   the stored responses held by remote caches and authoring tools. A strong
217   validator is unique across all representations of a given resource, such
218   that no two representations of that resource can share the same validator
219   unless their representation data is identical.
220</t>
221<t>
222   Cache entries might persist for arbitrarily long periods, regardless
223   of expiration times.  Thus, a cache might attempt to validate an
224   entry using a validator that it obtained in the distant past.
225   A strong validator is unique across all versions of all
226   representations associated with a particular resource over time.
227   However, there is no implication of uniqueness across representations
228   of different resources (i.e., the same strong validator might be
229   in use for representations of multiple resources at the same time
230   and does not imply that those representations are equivalent).
231</t>
232<t>
233   There are a variety of strong validators used in practice.  The best are
234   based on strict revision control, wherein each change to a representation
235   always results in a unique node name and revision identifier being assigned
236   before the representation is made accessible to GET.  A collision-resistant hash
237   function applied to the representation data is also sufficient if the data
238   is available prior to the response header fields being sent and the digest
239   does not need to be recalculated every time a validation request is
240   received.  However, if a resource has distinct representations that differ
241   only in their metadata, such as might occur with content negotiation over
242   media types that happen to share the same data format, then the origin
243   server &SHOULD; incorporate additional information in the validator to
244   distinguish those representations and avoid confusing cache behavior.
245</t>
246<t>
247   In contrast, a "weak validator" is representation metadata that
248   might not change for every change to the representation data.  This
249   weakness might be due to limitations in how the value is calculated, such
250   as clock resolution or an inability to ensure uniqueness for all possible
251   representations of the resource, or due to a desire by the resource owner
252   to group representations by some self-determined set of equivalency
253   rather than unique sequences of data.  An origin server &SHOULD; change a
254   weak entity-tag whenever it considers prior representations to be
255   unacceptable as a substitute for the current representation. In other words,
256   a weak entity-tag ought to change whenever the origin server wants caches to
257   invalidate old responses.
258</t>
259<t>
260   For example, the representation of a weather report that changes in
261   content every second, based on dynamic measurements, might be grouped
262   into sets of equivalent representations (from the origin server's
263   perspective) with the same weak validator in order to allow cached
264   representations to be valid for a reasonable period of time (perhaps
265   adjusted dynamically based on server load or weather quality).
266   Likewise, a representation's modification time, if defined with only
267   one-second resolution, might be a weak validator if it is possible
268   for the representation to be modified twice during a single second and
269   retrieved between those modifications.
270</t>
271<t>
272   Likewise, a validator is weak if it is shared by two or more
273   representations of a given resource at the same time, unless those
274   representations have identical representation data. For example, if the
275   origin server sends the same validator for a representation with a gzip
276   content coding applied as it does for a representation with no content
277   coding, then that validator is weak. However, two simultaneous
278   representations might share the same strong validator if they differ only
279   in the representation metadata, such as when two different media types are
280   available for the same representation data.
281</t>
282<t>
283   A "use" of a validator occurs when either a client generates a request
284   and includes the validator in a precondition or when a server
285   compares two validators.
286   Weak validators are only usable in contexts that do not depend on exact
287   equality of the representation data.
288   Strong validators are usable and preferred for all conditional requests,
289   including cache validation, partial content ranges, and "lost update"
290   avoidance.
291</t>
292</section>
293
294<section title="Last-Modified" anchor="header.last-modified">
295  <iref primary="true" item="Last-Modified header field" x:for-anchor=""/>
296  <x:anchor-alias value="Last-Modified"/>
297<t>
298   The "Last-Modified" header field in a response provides a timestamp
299   indicating the date and time at which the origin server believes the
300   selected representation was last modified, as determined at the conclusion
301   of handling the request.
302</t>
303<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Last-Modified"/>
304  <x:ref>Last-Modified</x:ref> = <x:ref>HTTP-date</x:ref>
305</artwork></figure>
306<t>
307   An example of its use is
308</t>
309<figure><artwork type="example">
310  Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT
311</artwork></figure>
312
313<section title="Generation" anchor="lastmod.generation">
314<t>
315   Origin servers &SHOULD; send Last-Modified for any selected
316   representation for which a last modification date can be reasonably
317   and consistently determined, since its use in conditional requests
318   and evaluating cache freshness (&caching;) results in a substantial
319   reduction of HTTP traffic on the Internet and can be a significant
320   factor in improving service scalability and reliability.
321</t>
322<t>
323   A representation is typically the sum of many parts behind the
324   resource interface.  The last-modified time would usually be
325   the most recent time that any of those parts were changed.
326   How that value is determined for any given resource is an
327   implementation detail beyond the scope of this specification.
328   What matters to HTTP is how recipients of the Last-Modified
329   header field can use its value to make conditional requests
330   and test the validity of locally cached responses.
331</t>
332<t>
333   An origin server &SHOULD; obtain the Last-Modified value of the
334   representation as close as possible to the time that it generates the
335   <x:ref>Date</x:ref> field value for its response. This allows a recipient to
336   make an accurate assessment of the representation's modification time,
337   especially if the representation changes near the time that the
338   response is generated.
339</t>
340<t>
341   An origin server with a clock &MUST-NOT; send a Last-Modified date
342   that is later than the server's time of message origination (<x:ref>Date</x:ref>).
343   If the last modification time is derived from implementation-specific
344   metadata that evaluates to some time in the future, according to the
345   origin server's clock, then the origin server &MUST; replace that
346   value with the message origination date. This prevents a future
347   modification date from having an adverse impact on cache validation.
348</t>
349<t>
350   An origin server without a clock &MUST-NOT; assign Last-Modified
351   values to a response unless these values were associated
352   with the resource by some other system or user with a reliable clock.
353</t>
354</section>
355
356<section title="Comparison" anchor="lastmod.comparison">
357<t>
358   A Last-Modified time, when used as a validator in a request, is
359   implicitly weak unless it is possible to deduce that it is strong,
360   using the following rules:
361  <list style="symbols">
362     <t>The validator is being compared by an origin server to the
363        actual current validator for the representation and,</t>
364     <t>That origin server reliably knows that the associated representation did
365        not change twice during the second covered by the presented
366        validator.</t>
367  </list>
368</t>
369<t>
370   or
371  <list style="symbols">
372     <t>The validator is about to be used by a client in an <x:ref>If-Modified-Since</x:ref>,
373        <x:ref>If-Unmodified-Since</x:ref> header field, because the client has
374        a cache entry, or <x:ref>If-Range</x:ref> for the associated
375        representation, and</t>
376     <t>That cache entry includes a <x:ref>Date</x:ref> value, which gives the
377        time when the origin server sent the original response, and</t>
378     <t>The presented Last-Modified time is at least 60 seconds before
379        the Date value.</t>
380  </list>
381</t>
382<t>
383   or
384  <list style="symbols">
385     <t>The validator is being compared by an intermediate cache to the
386        validator stored in its cache entry for the representation, and</t>
387     <t>That cache entry includes a <x:ref>Date</x:ref> value, which gives the
388        time when the origin server sent the original response, and</t>
389     <t>The presented Last-Modified time is at least 60 seconds before
390        the Date value.</t>
391  </list>
392</t>
393<t>
394   This method relies on the fact that if two different responses were
395   sent by the origin server during the same second, but both had the
396   same Last-Modified time, then at least one of those responses would
397   have a <x:ref>Date</x:ref> value equal to its Last-Modified time. The
398   arbitrary 60-second limit guards against the possibility that the Date and
399   Last-Modified values are generated from different clocks, or at somewhat
400   different times during the preparation of the response. An
401   implementation &MAY; use a value larger than 60 seconds, if it is
402   believed that 60 seconds is too short.
403</t>
404</section>
405</section>
406
407<section title="ETag" anchor="header.etag">
408  <iref primary="true" item="ETag header field" x:for-anchor=""/>
409  <x:anchor-alias value="ETag"/>
410  <x:anchor-alias value="entity-tag"/>
411  <x:anchor-alias value="opaque-tag"/>
412  <x:anchor-alias value="weak"/>
413  <x:anchor-alias value="etagc"/>
414<t>
415   The "ETag" header field in a response provides the current entity-tag for
416   the selected representation, as determined at the conclusion of handling
417   the request.
418   An entity-tag is an opaque validator for differentiating between
419   multiple representations of the same resource, regardless of whether
420   those multiple representations are due to resource state changes over
421   time, content negotiation resulting in multiple representations being
422   valid at the same time, or both. An entity-tag consists of an opaque
423   quoted string, possibly prefixed by a weakness indicator.
424</t>
425<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="ETag"/><iref primary="true" item="Grammar" subitem="entity-tag"/><iref primary="true" item="Grammar" subitem="weak"/><iref primary="true" item="Grammar" subitem="opaque-tag"/><iref primary="true" item="Grammar" subitem="etagc"/>
426  <x:ref>ETag</x:ref>       = <x:ref>entity-tag</x:ref>
427
428  <x:ref>entity-tag</x:ref> = [ <x:ref>weak</x:ref> ] <x:ref>opaque-tag</x:ref>
429  <x:ref>weak</x:ref>       = <x:abnf-char-sequence>"W/"</x:abnf-char-sequence> ; "W/", case-sensitive
430  <x:ref>opaque-tag</x:ref> = <x:ref>DQUOTE</x:ref> *<x:ref>etagc</x:ref> <x:ref>DQUOTE</x:ref>
431  <x:ref>etagc</x:ref>      = %x21 / %x23-7E / <x:ref>obs-text</x:ref>
432             ; <x:ref>VCHAR</x:ref> except double quotes, plus obs-text
433</artwork></figure>
434<x:note>
435  <t>
436    &Note; Previously, opaque-tag was defined to be a quoted-string
437    (<xref target="RFC2616" x:fmt="," x:sec="3.11"/>), thus some recipients
438    might perform backslash unescaping. Servers therefore ought to avoid
439    backslash characters in entity tags.
440  </t>
441</x:note>
442<t>
443   An entity-tag can be more reliable for validation than a modification
444   date in situations where it is inconvenient to store modification
445   dates, where the one-second resolution of HTTP date values is not
446   sufficient, or where modification dates are not consistently maintained.
447</t>
448<figure><preamble>
449  Examples:
450</preamble>
451<artwork type="example">
452  ETag: "xyzzy"
453  ETag: W/"xyzzy"
454  ETag: ""
455</artwork></figure>
456<t>
457   An entity-tag can be either a weak or strong validator, with
458   strong being the default.  If an origin server provides an entity-tag
459   for a representation and the generation of that entity-tag does not satisfy
460   all of the characteristics of a strong validator
461   (<xref target="weak.and.strong.validators"/>), then the origin server
462   &MUST; mark the entity-tag as weak by prefixing its opaque value
463   with "W/" (case-sensitive).
464</t>
465
466<section title="Generation" anchor="entity.tag.generation">
467<t>
468   The principle behind entity-tags is that only the service author
469   knows the implementation of a resource well enough to select the
470   most accurate and efficient validation mechanism for that resource,
471   and that any such mechanism can be mapped to a simple sequence of
472   octets for easy comparison.  Since the value is opaque, there is no
473   need for the client to be aware of how each entity-tag is constructed.
474</t>
475<t>
476   For example, a resource that has implementation-specific versioning
477   applied to all changes might use an internal revision number, perhaps
478   combined with a variance identifier for content negotiation, to
479   accurately differentiate between representations.
480   Other implementations might use a collision-resistant hash of
481   representation content,
482   a combination of various filesystem attributes, or a modification
483   timestamp that has sub-second resolution.
484</t>
485<t>
486   Origin servers &SHOULD; send ETag for any selected representation
487   for which detection of changes can be reasonably and consistently
488   determined, since the entity-tag's use in conditional requests and
489   evaluating cache freshness (&caching;) can result in a substantial
490   reduction of HTTP network traffic and can be a significant factor in
491   improving service scalability and reliability.
492</t>
493</section>
494
495<section title="Comparison" anchor="entity.tag.comparison">
496  <x:anchor-alias value="validator.comparison"/>
497  <x:anchor-alias value="strong comparison"/>
498  <x:anchor-alias value="weak comparison"/>
499<t>
500   There are two entity-tag comparison functions, depending
501   on whether the comparison context allows the use of weak validators
502   or not:
503  <list style="symbols">
504     <t><x:dfn>Strong comparison</x:dfn>: two entity-tags are equivalent if both
505        are not weak and their opaque-tags match character-by-character.</t>
506     <t><x:dfn>Weak comparison</x:dfn>: two entity-tags are equivalent if their opaque-tags
507        match character-by-character, regardless of either or both
508        being tagged as "weak".</t>
509  </list>
510</t>
511<t>
512   The example below shows the results for a set of entity-tag pairs,
513   and both the weak and strong comparison function results:
514</t>
515<texttable align="left">
516  <ttcol>ETag 1</ttcol>
517  <ttcol>ETag 2</ttcol>
518  <ttcol>Strong Comparison</ttcol>
519  <ttcol>Weak Comparison</ttcol>
520
521  <c>W/"1"</c>
522  <c>W/"1"</c>
523  <c>no match</c>
524  <c>match</c>
525 
526  <c>W/"1"</c>
527  <c>W/"2"</c>
528  <c>no match</c>
529  <c>no match</c>
530
531  <c>W/"1"</c>
532  <c>"1"</c>
533  <c>no match</c>
534  <c>match</c>
535
536  <c>"1"</c>
537  <c>"1"</c>
538  <c>match</c>
539  <c>match</c>
540</texttable>
541</section>
542
543<section title="Example: Entity-tags Varying on Content-Negotiated Resources" anchor="example.entity.tag.vs.conneg">
544<t>
545   Consider a resource that is subject to content negotiation
546   (&content-negotiation;), and where the representations sent in response to
547   a GET request vary based on the <x:ref>Accept-Encoding</x:ref> request
548   header field (&header-accept-encoding;):
549</t>
550<figure><preamble>>> Request:</preamble><artwork type="message/http; msgtype=&#34;request&#34;"  x:indent-with="  ">
551GET /index HTTP/1.1
552Host: www.example.com
553Accept-Encoding: gzip
554
555</artwork></figure>
556<t>
557   In this case, the response might or might not use the gzip content coding.
558   If it does not, the response might look like:
559</t>
560<figure><preamble>>> Response:</preamble><artwork type="message/http; msgtype=&#34;response&#34;"  x:indent-with="  ">
561HTTP/1.1 200 OK
562Date: Fri, 26 Mar 2010 00:05:00 GMT
563ETag: "123-a"
564Content-Length: <x:length-of target="exbody"/>
565Vary: Accept-Encoding
566Content-Type: text/plain
567
568<x:span anchor="exbody">Hello World!
569Hello World!
570Hello World!
571Hello World!
572Hello World!
573</x:span></artwork></figure>
574<t>
575   An alternative representation that does use gzip content coding would be:
576</t>
577<figure><preamble>>> Response:</preamble><artwork type="message/http; msgtype=&#34;response&#34;"  x:indent-with="  ">
578HTTP/1.1 200 OK
579Date: Fri, 26 Mar 2010 00:05:00 GMT
580ETag: "123-b"
581Content-Length: 43
582Vary: Accept-Encoding
583Content-Type: text/plain
584Content-Encoding: gzip
585
586<spanx>...binary data...</spanx></artwork></figure>
587<x:note>
588  <t>
589    &Note; Content codings are a property of the representation,
590    so therefore an entity-tag of an encoded representation has to be distinct
591    from an unencoded representation to prevent conflicts during cache updates
592    and range requests.  In contrast, transfer codings (&transfer-codings;)
593    apply only during message transfer and do not require distinct entity-tags.
594  </t>
595</x:note>
596</section>
597</section>
598
599<section title="When to Use Entity-tags and Last-Modified Dates" anchor="when.to.use.entity.tags.and.last-modified.dates">
600<t>
601   We adopt a set of rules and recommendations for origin servers,
602   clients, and caches regarding when various validator types ought to
603   be used, and for what purposes.
604</t>
605<t>
606   In <x:ref>200 (OK)</x:ref> responses to GET or HEAD, an origin server:
607  <list style="symbols">
608     <t>&SHOULD; send an entity-tag validator unless it is not feasible to
609        generate one.</t>
610
611     <t>&MAY; send a weak entity-tag instead of a strong entity-tag, if
612        performance considerations support the use of weak entity-tags,
613        or if it is unfeasible to send a strong entity-tag.</t>
614
615     <t>&SHOULD; send a <x:ref>Last-Modified</x:ref> value if it is feasible to
616        send one.</t>
617  </list>
618</t>
619<t>
620   In other words, the preferred behavior for an origin server
621   is to send both a strong entity-tag and a <x:ref>Last-Modified</x:ref>
622   value in successful responses to a retrieval request.
623</t>
624<t>
625   A client:
626  <list style="symbols">
627     <t>&MUST; use that entity-tag in any cache-conditional request (using
628        <x:ref>If-Match</x:ref> or <x:ref>If-None-Match</x:ref>) if an
629        entity-tag has been provided by the origin server.</t>
630
631     <t>&SHOULD; use the <x:ref>Last-Modified</x:ref> value in non-subrange
632        cache-conditional requests (using <x:ref>If-Modified-Since</x:ref>)
633        if only a Last-Modified value has been provided by the origin server.</t>
634
635     <t>&MAY; use the <x:ref>Last-Modified</x:ref> value in subrange
636        cache-conditional requests (using <x:ref>If-Unmodified-Since</x:ref>)
637        if only a Last-Modified value has been provided by an HTTP/1.0 origin
638        server. The user agent &SHOULD; provide a way to disable this, in case
639        of difficulty.</t>
640
641     <t>&SHOULD; use both validators in cache-conditional requests if both an
642        entity-tag and a <x:ref>Last-Modified</x:ref> value have been provided
643        by the origin server. This allows both HTTP/1.0 and HTTP/1.1 caches to
644        respond appropriately.</t>
645  </list>
646</t>
647</section>
648</section>
649
650<section title="Precondition Header Fields" anchor="header.field.definitions">
651<t>
652   This section defines the syntax and semantics of HTTP/1.1 header fields
653   for applying preconditions on requests.
654   <xref target="precedence"/> defines when the preconditions are applied and
655   the order of evaluation when more than one precondition is present.
656</t>
657
658<section title="If-Match" anchor="header.if-match">
659  <iref primary="true" item="If-Match header field" x:for-anchor=""/>
660  <x:anchor-alias value="If-Match"/>
661<t>
662   The "If-Match" header field can be used to make a request method conditional
663   on the current existence or value of an entity-tag for one or more
664   representations of the target resource.
665</t>
666<t>
667   If-Match is generally useful for resource update requests, such as PUT
668   requests, as a means for protecting against accidental overwrites when
669   multiple clients are acting in parallel on the same resource (i.e., the
670   "lost update" problem).  An If-Match field-value of "*" places the
671   precondition on the existence of any current representation for the
672   target resource.
673</t>
674<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Match"/>
675  <x:ref>If-Match</x:ref> = "*" / 1#<x:ref>entity-tag</x:ref>
676</artwork></figure>
677<t>
678   The If-Match condition is met if and only if any of the entity-tags listed
679   in the If-Match field value match the entity-tag of the selected
680   representation using the weak comparison function (as per <xref
681   target="entity.tag.comparison"/>), or if "*" is given and any current
682   representation exists for the target resource.
683</t>
684<t>
685   If the condition is met, the server &MAY; perform the request method.
686</t>
687<t>
688   Origin servers &MUST-NOT; perform the requested method if the condition is
689   not met; instead they &MUST; respond with the <x:ref>412 (Precondition
690   Failed)</x:ref> status code.
691</t>
692<t>
693   Proxy servers using a cached response as the selected representation
694   &MUST-NOT; perform the requested method if the condition is not met;
695   instead, they &MUST; forward the request towards the origin server.
696</t>
697<t>
698   Examples:
699</t>
700<figure><artwork type="example">
701  If-Match: "xyzzy"
702  If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
703  If-Match: *
704</artwork></figure>
705</section>
706
707<section title="If-None-Match" anchor="header.if-none-match">
708  <iref primary="true" item="If-None-Match header field" x:for-anchor=""/>
709  <x:anchor-alias value="If-None-Match"/>
710<t>
711   The "If-None-Match" header field can be used to make a request method
712   conditional on not matching any of the current entity-tag values for
713   representations of the target resource.
714</t>
715<t>
716   If-None-Match is primarily used in conditional GET requests to enable
717   efficient updates of cached information with a minimum amount of transaction
718   overhead. A client that has one or more representations previously obtained
719   from the target resource can send If-None-Match with a list of the
720   associated entity-tags in the hope of receiving a <x:ref>304 (Not
721   Modified)</x:ref> response if at least one of those representations matches
722   the selected representation.
723</t>
724<t>
725   If-None-Match can also be used with a value of "*" to prevent an unsafe
726   request method (e.g., PUT) from inadvertently modifying an existing
727   representation of the target resource when the client believes that
728   the resource does not have a current representation.  This is a variation
729   on the "lost update" problem that might arise if more than one client
730   attempts to create an initial representation for the target resource.
731</t>
732<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-None-Match"/>
733  <x:ref>If-None-Match</x:ref> = "*" / 1#<x:ref>entity-tag</x:ref>
734</artwork></figure>
735<t>
736   The If-None-Match condition is met if and only if none of the entity-tags
737   listed in the If-None-Match field value match the entity-tag of the selected
738   representation using the weak comparison function (as per <xref
739   target="entity.tag.comparison"/>), or if "*" is given and no current
740   representation exists for that resource.
741</t>
742<t>
743   If the condition is not met, the server &MUST-NOT; perform the requested
744   method. Instead, if the request method was GET or HEAD, the server &SHOULD;
745   respond with a <x:ref>304 (Not Modified)</x:ref> status code, including the
746   cache-related header fields (particularly <x:ref>ETag</x:ref>) of the
747   selected representation that has a matching entity-tag. For all other
748   request methods, the server &MUST; respond with a <x:ref>412 (Precondition
749   Failed)</x:ref> status code when the condition is not met.
750</t>
751<t>
752   If the condition is met, the server &MAY; perform the requested method and
753   &MUST; ignore any <x:ref>If-Modified-Since</x:ref> header field(s) in the
754   request. That is, if no entity-tags match, then the server &MUST-NOT; send
755   a <x:ref>304 (Not Modified)</x:ref> response.
756</t>
757<t>
758   Examples:
759</t>
760<figure><artwork type="example">
761  If-None-Match: "xyzzy"
762  If-None-Match: W/"xyzzy"
763  If-None-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
764  If-None-Match: W/"xyzzy", W/"r2d2xxxx", W/"c3piozzzz"
765  If-None-Match: *
766</artwork></figure>
767</section>
768
769<section title="If-Modified-Since" anchor="header.if-modified-since">
770  <iref primary="true" item="If-Modified-Since header field" x:for-anchor=""/>
771  <x:anchor-alias value="If-Modified-Since"/>
772<t>
773   The "If-Modified-Since" header field can be used with GET or HEAD to make
774   the method conditional by modification date: if the selected representation
775   has not been modified since the time specified in this field, then
776   do not perform the request method; instead, respond as detailed below.
777</t>
778<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Modified-Since"/>
779  <x:ref>If-Modified-Since</x:ref> = <x:ref>HTTP-date</x:ref>
780</artwork></figure>
781<t>
782   An example of the field is:
783</t>
784<figure><artwork type="example">
785  If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
786</artwork></figure>
787<t>
788   A GET method with an If-Modified-Since header field and no <x:ref>Range</x:ref>
789   header field requests that the selected representation be transferred only if
790   it has been modified since the date given by the If-Modified-Since
791   header field.
792   The algorithm for determining this includes the following cases:
793  <list style="numbers">
794      <t>If the request would normally result in anything other than a
795         <x:ref>200 (OK)</x:ref> status code, or if the passed If-Modified-Since date is
796         invalid, the response is exactly the same as for a normal GET.
797         A date that is later than the server's current time is
798         invalid.</t>
799
800      <t>If the selected representation has been modified since the
801         If-Modified-Since date, the response is exactly the same as for
802         a normal GET.</t>
803
804      <t>If the selected representation has not been modified since a valid
805         If-Modified-Since date, the server &SHOULD; send a
806         <x:ref>304 (Not Modified)</x:ref> response.</t>
807  </list>
808</t>
809<t>
810   The two purposes of this feature are to allow efficient updates of cached
811   information, with a minimum amount of transaction overhead, and to limit
812   the scope of a web traversal to resources that have recently changed.
813</t>
814<t>
815   When used for cache updates, a cache will typically use the value of the
816   cached message's <x:ref>Last-Modified</x:ref> field to generate the field
817   value of If-Modified-Since. This behavior is most interoperable for cases
818   where clocks are poorly synchronized or when the server has chosen to only
819   honor exact timestamp matches (due to a problem with Last-Modified dates
820   that appear to go "back in time" when the origin server's clock is
821   corrected or a representation is restored from an archived backup).
822   However, caches occasionally generate the field value based on other data,
823   such as the <x:ref>Date</x:ref> header field of the cached message or the
824   local clock time that the message was received, particularly when the
825   cached message does not contain a <x:ref>Last-Modified</x:ref> field.
826</t>
827<t>
828   When used for limiting the scope of retrieval to a recent time window, a
829   user agent will generate an If-Modified-Since field value based on either
830   its own local clock or a <x:ref>Date</x:ref> header field received from the
831   server during a past run. Origin servers that choose an exact timestamp
832   match based on the selected representation's <x:ref>Last-Modified</x:ref>
833   field will not be able to help the user agent limit its data transfers to
834   only those changed during the specified window.
835</t>
836<x:note>
837  <t>
838     &Note; If a client uses an arbitrary date in the If-Modified-Since
839     header field instead of a date taken from a <x:ref>Last-Modified</x:ref>
840     or <x:ref>Date</x:ref> header field from the origin server, the client
841     ought to be aware that its date will be interpreted according to the
842     server's understanding of time.
843  </t>
844</x:note>
845</section>
846
847<section title="If-Unmodified-Since" anchor="header.if-unmodified-since">
848  <iref primary="true" item="If-Unmodified-Since header field" x:for-anchor=""/>
849  <x:anchor-alias value="If-Unmodified-Since"/>
850<t>
851   The "If-Unmodified-Since" header field can be used to make a request
852   method conditional by modification date: if the selected representation
853   has been modified since the time specified in this field, then the
854   server &MUST-NOT; perform the requested operation and &MUST; instead
855   respond with the <x:ref>412 (Precondition Failed)</x:ref> status code.
856   If the selected representation has not been modified since the time
857   specified in this field, the server &MAY; perform the request.
858</t>
859<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Unmodified-Since"/>
860  <x:ref>If-Unmodified-Since</x:ref> = <x:ref>HTTP-date</x:ref>
861</artwork></figure>
862<t>
863   An example of the field is:
864</t>
865<figure><artwork type="example">
866  If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT
867</artwork></figure>
868<t>
869   A server &MUST; ignore the If-Unmodified-Since header field if the
870   received value is not a valid HTTP-date.
871</t>
872</section>
873
874<section title="If-Range" anchor="header.if-range">
875<t>
876   The "If-Range" header field provides a special conditional request
877   mechanism that is similar to <x:ref>If-Match</x:ref> and
878   <x:ref>If-Unmodified-Since</x:ref> but specific to range requests.
879   If-Range is defined in &header-if-range;.
880</t>
881</section>
882
883</section>
884
885<section title="Status Code Definitions" anchor="status.code.definitions">
886<section title="304 Not Modified" anchor="status.304">
887  <iref primary="true" item="304 Not Modified (status code)" x:for-anchor=""/>
888  <x:anchor-alias value="304"/>
889  <x:anchor-alias value="304 (Not Modified)"/>
890<t>
891   The <x:dfn>304 (Not Modified)</x:dfn> status code indicates that a
892   conditional GET or HEAD request has been
893   received and would have resulted in a <x:ref>200 (OK)</x:ref> response
894   if it were not for the fact that the condition has evaluated to false.
895   In other words, there is no need for the server to transfer a
896   representation of the target resource because the request indicates that
897   the client, which made the request conditional, already has a valid
898   representation; the server is therefore redirecting the client to make
899   use of that stored representation as if it were the payload of a
900   <x:ref>200 (OK)</x:ref> response.
901</t>
902<t>
903   The server generating a 304 response &MUST; generate any of the following
904   header fields that would have been sent in a <x:ref>200 (OK)</x:ref>
905   response to the same request:
906   <x:ref>Cache-Control</x:ref>,
907   <x:ref>Content-Location</x:ref>,
908   <x:ref>ETag</x:ref>,
909   <x:ref>Expires</x:ref>, and
910   <x:ref>Vary</x:ref>.
911</t>
912<t>
913   Since the goal of a 304 response is to minimize information transfer
914   when the recipient already has one or more cached representations,
915   a sender &SHOULD-NOT; generate representation metadata other
916   than the above listed fields unless said metadata exists for the
917   purpose of guiding cache updates (e.g., <x:ref>Last-Modified</x:ref> might
918   be useful if the response does not have an <x:ref>ETag</x:ref> field).
919</t>
920<t>
921   Requirements on a cache that receives a 304 response are defined in
922   &freshening-responses;. If the conditional request originated with an
923   outbound client, such as a user agent with its own cache sending a
924   conditional GET to a shared proxy, then the proxy &SHOULD; forward the
925   304 response to that client.
926</t>
927<t>
928   A 304 response cannot contain a message-body; it is always
929   terminated by the first empty line after the header fields.
930</t>
931</section>
932
933<section title="412 Precondition Failed" anchor="status.412">
934  <iref primary="true" item="412 Precondition Failed (status code)" x:for-anchor=""/>
935  <x:anchor-alias value="412 (Precondition Failed)"/>
936<t>
937   The <x:dfn>412 (Precondition Failed)</x:dfn> status code indicates that one
938   or more preconditions given in the request header fields evaluated to false
939   when tested on the server. This response code allows the client to place
940   preconditions on the current resource state (its current representations
941   and metadata) and thus prevent the request method from being applied if the
942   target resource is in an unexpected state.
943</t>
944</section>
945</section>
946
947<section title="Evaluation and Precedence" anchor="precedence">
948<t>
949   For each conditional request, a server &MUST; evaluate the request
950   preconditions after it has successfully performed its normal request checks
951   (i.e., just before it would perform the action associated with the request
952   method). Preconditions are ignored if the server determines that an error
953   or redirect response applies before they are evaluated. Otherwise, the
954   evaluation depends on both the method semantics and the choice of
955   conditional.
956</t>
957<t>
958   A conditional request header field that is designed specifically for cache
959   validation, which includes <x:ref>If-None-Match</x:ref> and
960   <x:ref>If-Modified-Since</x:ref> when used in a GET or HEAD request,
961   allows cached representations to be refreshed without repeatedly
962   transferring data already held by the client. Evaluating to false is thus
963   an indication that the client can continue to use its local copy of the
964   selected representation, as indicated by the server generating a
965   <x:ref>304 (Not Modified)</x:ref> response that includes only those header
966   fields useful for refreshing the cached representation.
967</t>
968<t>
969   All other conditionals are intended to signal failure when the
970   precondition evaluates to false. For example, an <x:ref>If-Match</x:ref>
971   conditional sent with a state-changing method (e.g., POST, PUT, DELETE) is
972   intended to prevent the request from taking effect on the target resource
973   if the resource state does not match the expected state. In other words,
974   evaluating the condition to false means that the resource has been changed
975   by some other client, perhaps by another user attempting to edit the same
976   resource, and thus preventing the request from being applied saves the
977   client from overwriting some other client's work. This result is indicated
978   by the server generating a <x:ref>412 (Precondition Failed)</x:ref>
979   response.
980</t>
981<t>
982   The conditional request header fields defined by this specification are
983   ignored for request methods that never involve the selection or
984   modification of a <x:ref>selected representation</x:ref> (e.g., CONNECT,
985   OPTIONS, and TRACE). Other conditional request header fields, defined by
986   extensions to HTTP, might place conditions on the state of the target
987   resource in general, or on a group of resources. For instance, the If header
988   field in WebDAV can make a request conditional on various aspects (such
989   as locks) of multiple resources
990   (<xref target="RFC4918" x:fmt="," x:sec="10.4"/>).
991</t>
992<t>
993   When more than one conditional request header field is present in a request,
994   the order in which the fields are evaluated becomes important. In practice,
995   the fields defined in this document are consistently implemented in a
996   single, logical order, due to the fact that entity tags are presumed to be
997   more accurate than date validators. For example, the only reason to send
998   both <x:ref>If-Modified-Since</x:ref> and <x:ref>If-None-Match</x:ref> in
999   the same GET request is to support intermediary caches that might not have
1000   implemented <x:ref>If-None-Match</x:ref>, so it makes sense to ignore the
1001   <x:ref>If-Modified-Since</x:ref> when entity tags are understood and
1002   available for the selected representation.
1003</t>
1004<t>
1005   The general rule of conditional precedence is that exact match conditions
1006   are evaluated before cache-validating conditions and, within that order,
1007   last-modified conditions are only evaluated if the corresponding
1008   entity tag condition is not present (or not applicable because the
1009   selected representation does not have an entity tag).
1010</t>
1011<t>
1012   Specifically, the fields defined by this specification are evaluated
1013   as follows:
1014   <list style="numbers">
1015     <t>When <x:ref>If-Match</x:ref> is present, evaluate it:
1016       <list style="symbols">
1017         <t>if true, continue to step 3</t>
1018         <t>if false, respond <x:ref>412 (Precondition Failed)</x:ref></t>
1019       </list>
1020     </t>
1021     <t>When <x:ref>If-Match</x:ref> is not present and
1022        <x:ref>If-Unmodified-Since</x:ref> is present, evaluate it:
1023       <list style="symbols">
1024         <t>if true, continue to step 3</t>
1025         <t>if false, respond <x:ref>412 (Precondition Failed)</x:ref></t>
1026       </list>
1027     </t>
1028     <t>When <x:ref>If-None-Match</x:ref> is present, evaluate it:
1029       <list style="symbols">
1030         <t>if true, continue to step 5</t>
1031         <t>if false for GET/HEAD, respond <x:ref>304 (Not Modified)</x:ref></t>
1032         <t>if false for other methods, respond <x:ref>412 (Precondition Failed)</x:ref></t>
1033       </list>
1034     </t>
1035     <t>When the method is GET or HEAD,
1036        <x:ref>If-None-Match</x:ref> is not present, and
1037        <x:ref>If-Modified-Since</x:ref> is present, evaluate it:
1038       <list style="symbols">
1039         <t>if true, continue to step 5</t>
1040         <t>if false, respond <x:ref>304 (Not Modified)</x:ref></t>
1041       </list>
1042     </t>
1043     <t>When the method is GET and both <x:ref>Range</x:ref> and
1044        <x:ref>If-Range</x:ref> are present, evaluate If-Range:
1045       <list style="symbols">
1046         <t>if the validator matches and the Range specification is
1047            applicable to the selected representation, respond
1048            <x:ref>206 (Partial Content)</x:ref> <xref target="Part5"/></t>
1049       </list>
1050     </t>
1051     <t>Otherwise,
1052       <list style="symbols">
1053         <t>all conditions are met, so perform the requested action and
1054            respond according to its success or failure.</t>
1055       </list>
1056     </t>
1057   </list>
1058</t>
1059<t>
1060   Any extension to HTTP/1.1 that defines additional conditional request
1061   header fields ought to define its own expectations regarding the order
1062   for evaluating such fields in relation to those defined in this document
1063   and other conditionals that might be found in practice.
1064</t>
1065</section>
1066
1067<section title="IANA Considerations" anchor="IANA.considerations">
1068
1069<section title="Status Code Registration" anchor="status.code.registration">
1070<t>
1071   The HTTP Status Code Registry located at <eref target="http://www.iana.org/assignments/http-status-codes"/>
1072   shall be updated with the registrations below:
1073</t>
1074<?BEGININC p4-conditional.iana-status-codes ?>
1075<!--AUTOGENERATED FROM extract-status-code-defs.xslt, do not edit manually-->
1076<texttable align="left" suppress-title="true" anchor="iana.status.code.registration.table">
1077   <ttcol>Value</ttcol>
1078   <ttcol>Description</ttcol>
1079   <ttcol>Reference</ttcol>
1080   <c>304</c>
1081   <c>Not Modified</c>
1082   <c>
1083      <xref target="status.304"/>
1084   </c>
1085   <c>412</c>
1086   <c>Precondition Failed</c>
1087   <c>
1088      <xref target="status.412"/>
1089   </c>
1090</texttable>
1091<!--(END)-->
1092<?ENDINC p4-conditional.iana-status-codes ?>
1093</section>
1094
1095<section title="Header Field Registration" anchor="header.field.registration">
1096<t>
1097   The Message Header Field Registry located at <eref target="http://www.iana.org/assignments/message-headers/message-header-index.html"/> shall be updated
1098   with the permanent registrations below (see <xref target="BCP90"/>):
1099</t>
1100<?BEGININC p4-conditional.iana-headers ?>
1101<!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually-->
1102<texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
1103   <ttcol>Header Field Name</ttcol>
1104   <ttcol>Protocol</ttcol>
1105   <ttcol>Status</ttcol>
1106   <ttcol>Reference</ttcol>
1107
1108   <c>ETag</c>
1109   <c>http</c>
1110   <c>standard</c>
1111   <c>
1112      <xref target="header.etag"/>
1113   </c>
1114   <c>If-Match</c>
1115   <c>http</c>
1116   <c>standard</c>
1117   <c>
1118      <xref target="header.if-match"/>
1119   </c>
1120   <c>If-Modified-Since</c>
1121   <c>http</c>
1122   <c>standard</c>
1123   <c>
1124      <xref target="header.if-modified-since"/>
1125   </c>
1126   <c>If-None-Match</c>
1127   <c>http</c>
1128   <c>standard</c>
1129   <c>
1130      <xref target="header.if-none-match"/>
1131   </c>
1132   <c>If-Unmodified-Since</c>
1133   <c>http</c>
1134   <c>standard</c>
1135   <c>
1136      <xref target="header.if-unmodified-since"/>
1137   </c>
1138   <c>Last-Modified</c>
1139   <c>http</c>
1140   <c>standard</c>
1141   <c>
1142      <xref target="header.last-modified"/>
1143   </c>
1144</texttable>
1145<!--(END)-->
1146<?ENDINC p4-conditional.iana-headers ?>
1147<t>
1148   The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".
1149</t>
1150</section>
1151</section>
1152
1153<section title="Security Considerations" anchor="security.considerations">
1154<t>
1155   This section is meant to inform developers, information providers, and
1156   users of known security concerns specific to the HTTP/1.1 conditional
1157   request mechanisms. More general security considerations are addressed
1158   in HTTP messaging &messaging; and semantics &semantics;.
1159</t>
1160<t>
1161   The validators defined by this specification are not intended to ensure
1162   the validity of a representation, guard against malicious changes, or
1163   detect man-in-the-middle attacks. At best, they enable more efficient cache
1164   updates and optimistic concurrent writes when all participants are behaving
1165   nicely. At worst, the conditions will fail and the client will receive a
1166   response that is no more harmful than an HTTP exchange without conditional
1167   requests.
1168</t>
1169<t>
1170   An entity-tag can be abused in ways that create privacy risks. For example,
1171   a site might deliberately construct a semantically invalid entity-tag that
1172   is unique to the user or user agent, send it in a cacheable response with a
1173   long freshness time, and then read that entity-tag in later conditional
1174   requests as a means of re-identifying that user or user agent. Such an
1175   identifying tag would become a persistent identifier for as long as the
1176   user agent retained the original cache entry. User agents that cache
1177   representations ought to ensure that the cache is cleared or replaced
1178   whenever the user performs privacy-maintaining actions, such as clearing
1179   stored cookies or changing to a private browsing mode.
1180</t>
1181</section>
1182
1183<section title="Acknowledgments" anchor="acks">
1184<t>
1185  See &acks;.
1186</t>
1187</section>
1188</middle>
1189<back>
1190
1191<references title="Normative References">
1192
1193<reference anchor="Part1">
1194  <front>
1195    <title>Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</title>
1196    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1197      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
1198      <address><email>fielding@gbiv.com</email></address>
1199    </author>
1200    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1201      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1202      <address><email>julian.reschke@greenbytes.de</email></address>
1203    </author>
1204    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1205  </front>
1206  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"/>
1207  <x:source href="p1-messaging.xml" basename="p1-messaging"/>
1208</reference>
1209
1210<reference anchor="Part2">
1211  <front>
1212    <title>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</title>
1213    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1214      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
1215      <address><email>fielding@gbiv.com</email></address>
1216    </author>
1217    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1218      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1219      <address><email>julian.reschke@greenbytes.de</email></address>
1220    </author>
1221    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1222  </front>
1223  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p2-semantics-&ID-VERSION;"/>
1224  <x:source href="p2-semantics.xml" basename="p2-semantics">
1225    <x:defines>2xx</x:defines>
1226    <x:defines>2xx (Successful)</x:defines>
1227    <x:defines>200 (OK)</x:defines>
1228    <x:defines>Accept-Encoding</x:defines>
1229    <x:defines>Content-Location</x:defines>
1230    <x:defines>Content-Type</x:defines>
1231    <x:defines>Date</x:defines>
1232    <x:defines>Location</x:defines>
1233    <x:defines>Vary</x:defines>
1234    <x:defines>selected representation</x:defines>
1235  </x:source>
1236</reference>
1237
1238<reference anchor="Part5">
1239  <front>
1240    <title>Hypertext Transfer Protocol (HTTP/1.1): Range Requests</title>
1241    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1242      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
1243      <address><email>fielding@gbiv.com</email></address>
1244    </author>
1245    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1246      <organization abbrev="W3C">World Wide Web Consortium</organization>
1247      <address><email>ylafon@w3.org</email></address>
1248    </author>
1249    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1250      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1251      <address><email>julian.reschke@greenbytes.de</email></address>
1252    </author>
1253    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1254  </front>
1255  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p5-range-&ID-VERSION;"/>
1256  <x:source href="p5-range.xml" basename="p5-range">
1257    <x:defines>If-Range</x:defines>
1258    <x:defines>Range</x:defines>
1259    <x:defines>206 (Partial Content)</x:defines>
1260  </x:source>
1261</reference>
1262
1263<reference anchor="Part6">
1264  <front>
1265    <title>Hypertext Transfer Protocol (HTTP/1.1): Caching</title>
1266    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1267      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
1268      <address><email>fielding@gbiv.com</email></address>
1269    </author>
1270    <author initials="M." surname="Nottingham" fullname="Mark Nottingham" role="editor">
1271      <organization>Akamai</organization>
1272      <address><email>mnot@mnot.net</email></address>
1273    </author>
1274    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1275      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1276      <address><email>julian.reschke@greenbytes.de</email></address>
1277    </author>
1278    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1279  </front>
1280  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-&ID-VERSION;"/>
1281  <x:source href="p6-cache.xml" basename="p6-cache">
1282    <x:defines>Cache-Control</x:defines>
1283    <x:defines>Expires</x:defines>
1284  </x:source>
1285</reference>
1286
1287<reference anchor="RFC2119">
1288  <front>
1289    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
1290    <author initials="S." surname="Bradner" fullname="Scott Bradner">
1291      <organization>Harvard University</organization>
1292      <address><email>sob@harvard.edu</email></address>
1293    </author>
1294    <date month="March" year="1997"/>
1295  </front>
1296  <seriesInfo name="BCP" value="14"/>
1297  <seriesInfo name="RFC" value="2119"/>
1298</reference>
1299
1300<reference anchor="RFC5234">
1301  <front>
1302    <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title>
1303    <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor">
1304      <organization>Brandenburg InternetWorking</organization>
1305      <address>
1306        <email>dcrocker@bbiw.net</email>
1307      </address> 
1308    </author>
1309    <author initials="P." surname="Overell" fullname="Paul Overell">
1310      <organization>THUS plc.</organization>
1311      <address>
1312        <email>paul.overell@thus.net</email>
1313      </address>
1314    </author>
1315    <date month="January" year="2008"/>
1316  </front>
1317  <seriesInfo name="STD" value="68"/>
1318  <seriesInfo name="RFC" value="5234"/>
1319</reference>
1320
1321</references>
1322
1323<references title="Informative References">
1324
1325<reference anchor="RFC2616">
1326  <front>
1327    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
1328    <author initials="R." surname="Fielding" fullname="R. Fielding">
1329      <organization>University of California, Irvine</organization>
1330      <address><email>fielding@ics.uci.edu</email></address>
1331    </author>
1332    <author initials="J." surname="Gettys" fullname="J. Gettys">
1333      <organization>W3C</organization>
1334      <address><email>jg@w3.org</email></address>
1335    </author>
1336    <author initials="J." surname="Mogul" fullname="J. Mogul">
1337      <organization>Compaq Computer Corporation</organization>
1338      <address><email>mogul@wrl.dec.com</email></address>
1339    </author>
1340    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
1341      <organization>MIT Laboratory for Computer Science</organization>
1342      <address><email>frystyk@w3.org</email></address>
1343    </author>
1344    <author initials="L." surname="Masinter" fullname="L. Masinter">
1345      <organization>Xerox Corporation</organization>
1346      <address><email>masinter@parc.xerox.com</email></address>
1347    </author>
1348    <author initials="P." surname="Leach" fullname="P. Leach">
1349      <organization>Microsoft Corporation</organization>
1350      <address><email>paulle@microsoft.com</email></address>
1351    </author>
1352    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
1353      <organization>W3C</organization>
1354      <address><email>timbl@w3.org</email></address>
1355    </author>
1356    <date month="June" year="1999"/>
1357  </front>
1358  <seriesInfo name="RFC" value="2616"/>
1359</reference>
1360
1361<reference anchor='BCP90'>
1362  <front>
1363    <title>Registration Procedures for Message Header Fields</title>
1364    <author initials='G.' surname='Klyne' fullname='G. Klyne'>
1365      <organization>Nine by Nine</organization>
1366      <address><email>GK-IETF@ninebynine.org</email></address>
1367    </author>
1368    <author initials='M.' surname='Nottingham' fullname='M. Nottingham'>
1369      <organization>BEA Systems</organization>
1370      <address><email>mnot@pobox.com</email></address>
1371    </author>
1372    <author initials='J.' surname='Mogul' fullname='J. Mogul'>
1373      <organization>HP Labs</organization>
1374      <address><email>JeffMogul@acm.org</email></address>
1375    </author>
1376    <date year='2004' month='September' />
1377  </front>
1378  <seriesInfo name='BCP' value='90' />
1379  <seriesInfo name='RFC' value='3864' />
1380</reference>
1381
1382<reference anchor='RFC4918'>
1383  <front>
1384    <title>HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)</title>
1385    <author initials="L.M." surname="Dusseault" fullname="Lisa Dusseault" role="editor" >
1386      <organization abbrev="CommerceNet">CommerceNet</organization>
1387      <address><email>ldusseault@commerce.net</email></address>
1388    </author>
1389    <date month="June" year="2007" />
1390  </front>
1391  <seriesInfo name='RFC' value='4918' />
1392</reference>
1393</references>
1394
1395<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
1396<t>
1397  The definition of validator weakness has been expanded and clarified.
1398  (<xref target="weak.and.strong.validators" />)
1399</t>
1400<t>
1401  Weak entity-tags are now allowed in all requests except range requests
1402  (Sections <xref target="weak.and.strong.validators" format="counter"/> and
1403  <xref target="header.if-none-match" format="counter"/>).
1404</t>
1405<t>
1406  The <x:ref>ETag</x:ref> header field ABNF has been changed to not use
1407  quoted-string, thus avoiding escaping issues.
1408  (<xref target="header.etag" />)
1409</t>
1410<t>
1411  ETag is defined to provide an entity tag for the selected representation,
1412  thereby clarifying what it applies to in various situations (such as a
1413  PUT response).
1414  (<xref target="header.etag" />)
1415</t>
1416<t>
1417  The precedence for evaluation of conditional requests has been defined.
1418  (<xref target="precedence" />)
1419</t>
1420</section>
1421
1422<section title="Imported ABNF" anchor="imported.abnf">
1423  <x:anchor-alias value="ALPHA"/>
1424  <x:anchor-alias value="CR"/>
1425  <x:anchor-alias value="DIGIT"/>
1426  <x:anchor-alias value="DQUOTE"/>
1427  <x:anchor-alias value="LF"/>
1428  <x:anchor-alias value="OCTET"/>
1429  <x:anchor-alias value="VCHAR"/>
1430  <x:anchor-alias value="core.rules"/>
1431  <x:anchor-alias value="obs-text"/>
1432  <x:anchor-alias value="OWS"/>
1433  <x:anchor-alias value="HTTP-date"/>
1434<t>
1435  The following core rules are included by
1436  reference, as defined in <xref target="RFC5234" x:fmt="of" x:sec="B.1"/>:
1437  ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls),
1438  DIGIT (decimal 0-9), DQUOTE (double quote),
1439  HEXDIG (hexadecimal 0-9/A-F/a-f), LF (line feed),
1440  OCTET (any 8-bit sequence of data), SP (space), and
1441  VCHAR (any visible US-ASCII character).
1442</t>
1443<t>
1444  The rules below are defined in <xref target="Part1"/>:
1445</t>
1446<figure><artwork type="abnf2616">
1447  <x:ref>OWS</x:ref>           = &lt;OWS, defined in &whitespace;&gt;
1448  <x:ref>obs-text</x:ref>      = &lt;obs-text, defined in &field-components;&gt;
1449</artwork></figure>
1450<t>
1451  The rules below are defined in other parts:
1452</t>
1453<figure><artwork type="abnf2616">
1454  <x:ref>HTTP-date</x:ref>     = &lt;HTTP-date, defined in &http-date;&gt;
1455</artwork></figure>
1456</section> 
1457
1458<?BEGININC p4-conditional.abnf-appendix ?>
1459<section xmlns:x="http://purl.org/net/xml2rfc/ext" title="Collected ABNF" anchor="collected.abnf">
1460<t>
1461  In the collected ABNF below, list rules are expanded as per <xref target="Part1" x:rel="#notation"/>.
1462</t><figure>
1463<artwork type="abnf" name="p4-conditional.parsed-abnf">
1464<x:ref>ETag</x:ref> = entity-tag
1465
1466<x:ref>HTTP-date</x:ref> = &lt;HTTP-date, defined in [Part2], Section 7.1.1.1&gt;
1467
1468<x:ref>If-Match</x:ref> = "*" / ( *( "," OWS ) entity-tag *( OWS "," [ OWS
1469 entity-tag ] ) )
1470<x:ref>If-Modified-Since</x:ref> = HTTP-date
1471<x:ref>If-None-Match</x:ref> = "*" / ( *( "," OWS ) entity-tag *( OWS "," [ OWS
1472 entity-tag ] ) )
1473<x:ref>If-Unmodified-Since</x:ref> = HTTP-date
1474
1475<x:ref>Last-Modified</x:ref> = HTTP-date
1476
1477<x:ref>OWS</x:ref> = &lt;OWS, defined in [Part1], Section 3.2.3&gt;
1478
1479<x:ref>entity-tag</x:ref> = [ weak ] opaque-tag
1480<x:ref>etagc</x:ref> = "!" / %x23-7E ; '#'-'~'
1481 / obs-text
1482
1483<x:ref>obs-text</x:ref> = &lt;obs-text, defined in [Part1], Section 3.2.6&gt;
1484<x:ref>opaque-tag</x:ref> = DQUOTE *etagc DQUOTE
1485
1486<x:ref>weak</x:ref> = %x57.2F ; W/
1487</artwork>
1488</figure>
1489</section>
1490<?ENDINC p4-conditional.abnf-appendix ?>
1491
1492<section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log">
1493<t>
1494  Changes up to the first Working Group Last Call draft are summarized
1495  in <eref target="http://tools.ietf.org/html/draft-ietf-httpbis-p4-conditional-19#appendix-C"/>.
1496</t>
1497
1498<section title="Since draft-ietf-httpbis-p4-conditional-19" anchor="changes.since.19">
1499<t>
1500  Closed issues:
1501  <list style="symbols"> 
1502    <t>
1503      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/241"/>:
1504      "Need to clarify eval order/interaction of conditional headers"
1505    </t>
1506    <t>
1507      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/345"/>:
1508      "Required headers on 304 and 206"
1509    </t>
1510    <t>
1511      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/350"/>:
1512      "Optionality of Conditional Request Support"
1513    </t>
1514    <t>
1515      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/354"/>:
1516      "ETags and Conditional Requests"
1517    </t>
1518    <t>
1519      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/361"/>:
1520      "ABNF requirements for recipients"
1521    </t>
1522    <t>
1523      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/363"/>:
1524      "Rare cases"
1525    </t>
1526    <t>
1527      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/365"/>:
1528      "Conditional Request Security Considerations"
1529    </t>
1530    <t>
1531      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/371"/>:
1532      "If-Modified-Since lacks definition for method != GET"
1533    </t>
1534    <t>
1535      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/372"/>:
1536      "refactor conditional header field descriptions"
1537    </t>
1538  </list>
1539</t>
1540</section>
1541
1542<section title="Since draft-ietf-httpbis-p4-conditional-20" anchor="changes.since.20">
1543<t>
1544  <list style="symbols">
1545    <t>
1546      Conformance criteria and considerations regarding error handling are
1547      now defined in Part 1.
1548    </t>
1549  </list>
1550</t>
1551</section>
1552
1553<section title="Since draft-ietf-httpbis-p4-conditional-21" anchor="changes.since.21">
1554<t>
1555  Closed issues:
1556  <list style="symbols"> 
1557    <t>
1558      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/96"/>:
1559      "Conditional GET text"
1560    </t>
1561    <t>
1562      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/350"/>:
1563      "Optionality of Conditional Request Support"
1564    </t>
1565    <t>
1566      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/384"/>:
1567      "unclear prose in definition of 304"
1568    </t>
1569    <t>
1570      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/401"/>:
1571      "ETags and Conneg"
1572    </t>
1573    <t>
1574      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/402"/>:
1575      "Comparison function for If-Match and If-None-Match"
1576    </t>
1577    <t>
1578      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/406"/>:
1579      "304 without validator"
1580    </t>
1581    <t>
1582      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/427"/>:
1583      "If-Match and 428"
1584    </t>
1585  </list>
1586</t>
1587</section>
1588
1589<section title="Since draft-ietf-httpbis-p4-conditional-22" anchor="changes.since.22">
1590<t>
1591  Closed issues:
1592  <list style="symbols">
1593    <t>
1594      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/436"/>:
1595      "explain list expansion in ABNF appendices"
1596    </t>
1597    <t>
1598      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/437"/>:
1599      "incorrect example dates"
1600    </t>
1601  </list>
1602</t>
1603</section>
1604</section>
1605
1606</back>
1607</rfc>
Note: See TracBrowser for help on using the repository browser.