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

Last change on this file since 1906 was 1906, checked in by julian.reschke@…, 8 years ago

refresh appendices

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