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

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

More adjustments to "Changes from RFC2616", based upon the issues list.

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