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

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

(editorial) Explain the other purpose of If-Modified-Since and why its value might not be from a Last-Modified date; addresses #406

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