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

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

(editorial) make security considerations intro specific to each document and xref to the main ones

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