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

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

make editorial notes consistent, regen HTML after P1 TOC change

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