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

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

Update p4 abstract and introduction; replace redundancies with reference to p1

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