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

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

update to latest version of rfc2629.xslt, bump up document dates

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/xml
File size: 67.4 KB
[29]1<?xml version="1.0" encoding="utf-8"?>
[101]2<?xml-stylesheet type='text/xsl' href='../myxml2rfc.xslt'?>
[8]3<!DOCTYPE rfc [
4  <!ENTITY MAY "<bcp14 xmlns=''>MAY</bcp14>">
5  <!ENTITY MUST "<bcp14 xmlns=''>MUST</bcp14>">
6  <!ENTITY MUST-NOT "<bcp14 xmlns=''>MUST NOT</bcp14>">
7  <!ENTITY OPTIONAL "<bcp14 xmlns=''>OPTIONAL</bcp14>">
8  <!ENTITY RECOMMENDED "<bcp14 xmlns=''>RECOMMENDED</bcp14>">
9  <!ENTITY REQUIRED "<bcp14 xmlns=''>REQUIRED</bcp14>">
10  <!ENTITY SHALL "<bcp14 xmlns=''>SHALL</bcp14>">
11  <!ENTITY SHALL-NOT "<bcp14 xmlns=''>SHALL NOT</bcp14>">
12  <!ENTITY SHOULD "<bcp14 xmlns=''>SHOULD</bcp14>">
13  <!ENTITY SHOULD-NOT "<bcp14 xmlns=''>SHOULD NOT</bcp14>">
[29]14  <!ENTITY ID-VERSION "latest">
[1825]15  <!ENTITY ID-MONTH "August">
[1497]16  <!ENTITY ID-YEAR "2012">
[1692]17  <!ENTITY Note "<x:h xmlns:x=''>Note:</x:h>">
[1452]18  <!ENTITY architecture               "<xref target='Part1' x:rel='#architecture' xmlns:x=''/>">
[424]19  <!ENTITY notation                   "<xref target='Part1' x:rel='#notation' xmlns:x=''/>">
[1518]20  <!ENTITY abnf-extension             "<xref target='Part1' x:rel='#abnf.extension' xmlns:x=''/>">
[1364]21  <!ENTITY acks                       "<xref target='Part1' x:rel='#acks' xmlns:x=''/>">
[1518]22  <!ENTITY whitespace                 "<xref target='Part1' x:rel='#whitespace' xmlns:x=''/>">
23  <!ENTITY field-components           "<xref target='Part1' x:rel='#field.components' xmlns:x=''/>">
[1436]24  <!ENTITY header-date                "<xref target='Part2' x:rel='' xmlns:x=''/>">
[31]25  <!ENTITY messaging                  "<xref target='Part1' xmlns:x=''/>">
[163]26  <!ENTITY caching                    "<xref target='Part6' xmlns:x=''/>">
[1643]27  <!ENTITY header-accept-encoding     "<xref target='Part2' x:rel='#header.accept-encoding' xmlns:x=''/>">
[31]28  <!ENTITY header-if-range            "<xref target='Part5' x:rel='#header.if-range' xmlns:x=''/>">
29  <!ENTITY header-range               "<xref target='Part5' x:rel='#header.range' xmlns:x=''/>">
30  <!ENTITY header-vary                "<xref target='Part6' x:rel='#header.vary' xmlns:x=''/>">
[1436]31  <!ENTITY http-date                  "<xref target='Part2' x:rel='' xmlns:x=''/>">
[800]32  <!ENTITY transfer-codings           "<xref target='Part1' x:rel='#transfer.codings' xmlns:x=''/>">
[1643]33  <!ENTITY content-negotiation        "<xref target='Part2' x:rel='#content.negotiation' xmlns:x=''/>">
35<?rfc toc="yes" ?>
[29]36<?rfc symrefs="yes" ?>
37<?rfc sortrefs="yes" ?>
[8]38<?rfc compact="yes"?>
39<?rfc subcompact="no" ?>
40<?rfc linkmailto="no" ?>
41<?rfc editing="no" ?>
[203]42<?rfc comments="yes"?>
43<?rfc inline="yes"?>
[799]44<?rfc rfcedstyle="yes"?>
[8]45<?rfc-ext allow-markup-in-artwork="yes" ?>
46<?rfc-ext include-references-in-index="yes" ?>
[1477]47<rfc obsoletes="2616" category="std" x:maturity-level="proposed"
[446]48     ipr="pre5378Trust200902" docName="draft-ietf-httpbis-p4-conditional-&ID-VERSION;"
[153]49     xmlns:x=''>
[1810]50<x:link rel="prev" basename="p2-semantics"/>
[1472]51<x:link rel="next" basename="p5-range"/>
[1522]52<x:feedback template="{docname},%20%22{section}%22&amp;body=&lt;{ref}&gt;:"/>
[120]55  <title abbrev="HTTP/1.1, Part 4">HTTP/1.1, part 4: Conditional Requests</title>
[29]57  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
[1106]58    <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
[8]59    <address>
60      <postal>
[1106]61        <street>345 Park Ave</street>
62        <city>San Jose</city>
[8]63        <region>CA</region>
[1106]64        <code>95110</code>
[29]65        <country>USA</country>
[8]66      </postal>
[29]67      <email></email>
68      <uri></uri>
[8]69    </address>
70  </author>
[95]72  <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
[94]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></email>
84      <uri></uri>
85    </address>
86  </author>
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>
[609]96      <email></email>
97      <uri></uri>
[95]98    </address>
99  </author>
[31]101  <date month="&ID-MONTH;" year="&ID-YEAR;"/>
[440]102  <workgroup>HTTPbis Working Group</workgroup>
[1373]106   The Hypertext Transfer Protocol (HTTP) is an application-level protocol for
[1783]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.
115<note title="Editorial Note (To be removed by RFC Editor)">
116  <t>
[1764]117    Discussion of this draft takes place on the HTTPBIS working group
[1268]118    mailing list (, which is archived at
119    <eref target=""/>.
120  </t>
121  <t>
122    The current issues list is at
123    <eref target=""/> and related
124    documents (including fancy diffs) can be found at
[324]125    <eref target=""/>.
[36]126  </t>
[153]127  <t>
[1807]128    The changes in this draft are summarized in <xref target="changes.since.20"/>.
[153]129  </t>
134<section title="Introduction" anchor="introduction">
[1783]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
[1786]143   <xref target="Part1"/>.
[1380]146   Conditional GET requests are the most efficient mechanism for HTTP
147   cache updates &caching;.  Conditionals can also be
[1251]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.
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.
[1224]164<t><iref primary="true" item="selected representation"/>
[1251]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.
174<section title="Conformance and Error Handling" anchor="intro.conformance.and.error.handling">
176   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
177   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
178   document are to be interpreted as described in <xref target="RFC2119"/>.
181   This specification targets conformance criteria according to the role of
182   a participant in HTTP communication.  Hence, HTTP requirements are placed
183   on senders, recipients, clients, servers, user agents, intermediaries,
184   origin servers, proxies, gateways, or caches, depending on what behavior
185   is being constrained by the requirement. See &architecture; for definitions
186   of these terms.
189   The verb "generate" is used instead of "send" where a requirement
190   differentiates between creating a protocol element and merely forwarding a
191   received element downstream.
194   An implementation is considered conformant if it complies with all of the
195   requirements associated with the roles it partakes in HTTP. Note that
196   SHOULD-level requirements are relevant here, unless one of the documented
197   exceptions is applicable.
200   This document also uses ABNF to define valid protocol elements
201   (<xref target="notation"/>).
202   In addition to the prose requirements placed upon them, senders &MUST-NOT;
203   generate protocol elements that do not match the grammar defined by the
204   ABNF rules for those protocol elements that are applicable to the sender's
205   role. If a received protocol element is processed, the recipient &MUST; be
206   able to parse any value that would match the ABNF rules for that protocol
207   element, excluding only those rules not applicable to the recipient's role.
210   Unless noted otherwise, a recipient &MAY; attempt to recover a usable
211   protocol element from an invalid construct.  HTTP does not define
212   specific error handling mechanisms except when they have a direct impact
213   on security, since different applications of the protocol require
214   different error handling strategies.  For example, a Web browser might
215   wish to transparently recover from a response where the
216   <x:ref>Location</x:ref> header field doesn't parse according to the ABNF,
217   whereas a systems control client might consider any form of error recovery
218   to be dangerous.
[1796]222<section title="Syntax Notation" anchor="notation">
224   This specification uses the Augmented Backus-Naur Form (ABNF) notation
225   of <xref target="RFC5234"/> with the list rule extension defined in
[1805]226   &notation;. <xref target="imported.abnf"/> describes rules imported from
227   other documents. <xref target="collected.abnf"/> shows the collected ABNF
[1796]228   with the list rule expanded.
[1380]233<section title="Validators" anchor="validators">
[1253]234   <iref primary="true" item="metadata"/>
235   <iref primary="true" item="validator"/>
[1251]237   This specification defines two forms of metadata that are commonly used
238   to observe resource state and test for preconditions: modification dates
[1733]239   (<xref target="header.last-modified"/>) and opaque entity tags
240   (<xref target="header.etag"/>).  Additional metadata that reflects resource state
[1251]241   has been defined by various extensions of HTTP, such as WebDAV
242   <xref target="RFC4918"/>, that are beyond the scope of this specification.
[1260]243   A resource metadata value is referred to as a "<x:dfn>validator</x:dfn>"
244   when it is used within a precondition.
[1379]247<section title="Weak versus Strong" anchor="weak.and.strong.validators">
[1380]248   <iref primary="true" item="validator" subitem="weak"/>
249   <iref primary="true" item="validator" subitem="strong"/>
[1380]251   Validators come in two flavors: strong or weak.  Weak validators are easy
252   to generate but are far less useful for comparisons.  Strong validators
253   are ideal for comparisons but can be very difficult (and occasionally
254   impossible) to generate efficiently.  Rather than impose that all forms
255   of resource adhere to the same strength of validator, HTTP exposes the
256   type of validator in use and imposes restrictions on when weak validators
257   can be used as preconditions.
[1380]260   A "strong validator" is a representation metadata value that &MUST; be
261   changed to a new, previously unused or guaranteed unique, value whenever
262   a change occurs to the representation data such that a change would be
[1715]263   observable in the payload body of a <x:ref>200 (OK)</x:ref> response to GET.
[1715]266   A strong validator &MAY; be changed for other reasons, such as when a semantically
[1380]267   significant part of the representation metadata is changed (e.g.,
[1740]268   <x:ref>Content-Type</x:ref>), but it is in the best interests of the origin
269   server to only change the value when it is necessary to invalidate the
270   stored responses held by remote caches and authoring tools.  A strong
271   validator &MUST; be unique across all representations of a given resource,
272   such that no two representations of that resource share the same validator
273   unless their payload body would be identical.
276   Cache entries might persist for arbitrarily long periods, regardless
277   of expiration times.  Thus, a cache might attempt to validate an
278   entry using a validator that it obtained in the distant past.
[1380]279   A strong validator &MUST; be unique across all versions of all
[1379]280   representations associated with a particular resource over time.
[1380]281   However, there is no implication of uniqueness across representations
282   of different resources (i.e., the same strong validator might be
[1379]283   in use for representations of multiple resources at the same time
284   and does not imply that those representations are equivalent).
[1380]287   There are a variety of strong validators used in practice.  The best are
288   based on strict revision control, wherein each change to a representation
289   always results in a unique node name and revision identifier being assigned
[1801]290   before the representation is made accessible to GET.  A collision-resistant hash
[1380]291   function applied to the representation data is also sufficient if the data
292   is available prior to the response header fields being sent and the digest
293   does not need to be recalculated every time a validation request is
294   received.  However, if a resource has distinct representations that differ
295   only in their metadata, such as might occur with content negotiation over
[1691]296   media types that happen to share the same data format, then the origin
297   server &SHOULD; incorporate additional information in the validator to
[1380]298   distinguish those representations and avoid confusing cache behavior.
[1380]301   In contrast, a "weak validator" is a representation metadata value that
302   might not be changed for every change to the representation data.  This
303   weakness might be due to limitations in how the value is calculated, such
304   as clock resolution or an inability to ensure uniqueness for all possible
305   representations of the resource, or due to a desire by the resource owner
306   to group representations by some self-determined set of equivalency
[1691]307   rather than unique sequences of data.  An origin server &SHOULD; change a
308   weak entity-tag whenever it considers prior representations to be
309   unacceptable as a substitute for the current representation. In other words,
310   a weak entity-tag ought to change whenever the origin server wants caches to
311   invalidate old responses.
314   For example, the representation of a weather report that changes in
315   content every second, based on dynamic measurements, might be grouped
316   into sets of equivalent representations (from the origin server's
317   perspective) with the same weak validator in order to allow cached
318   representations to be valid for a reasonable period of time (perhaps
319   adjusted dynamically based on server load or weather quality).
320   Likewise, a representation's modification time, if defined with only
321   one-second resolution, might be a weak validator if it is possible
322   for the representation to be modified twice during a single second and
323   retrieved between those modifications.
326   A "use" of a validator occurs when either a client generates a request
327   and includes the validator in a precondition or when a server
328   compares two validators.
329   Weak validators are only usable in contexts that do not depend on exact
330   equality of a representation's payload body.
331   Strong validators are usable and preferred for all conditional requests,
332   including cache validation, partial content ranges, and "lost update"
333   avoidance.
[1253]337<section title="Last-Modified" anchor="header.last-modified">
338  <iref primary="true" item="Last-Modified header field" x:for-anchor=""/>
339  <iref primary="true" item="Header Fields" subitem="Last-Modified" x:for-anchor=""/>
340  <x:anchor-alias value="Last-Modified"/>
342   The "Last-Modified" header field indicates the date and time at
[1260]343   which the origin server believes the selected representation was
344   last modified.
346<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Last-Modified"/>
347  <x:ref>Last-Modified</x:ref> = <x:ref>HTTP-date</x:ref>
350   An example of its use is
352<figure><artwork type="example">
353  Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT
356<section title="Generation" anchor="lastmod.generation">
[1260]358   Origin servers &SHOULD; send Last-Modified for any selected
359   representation for which a last modification date can be reasonably
360   and consistently determined, since its use in conditional requests
361   and evaluating cache freshness (&caching;) results in a substantial
362   reduction of HTTP traffic on the Internet and can be a significant
363   factor in improving service scalability and reliability.
[1253]366   A representation is typically the sum of many parts behind the
367   resource interface.  The last-modified time would usually be
368   the most recent time that any of those parts were changed.
369   How that value is determined for any given resource is an
370   implementation detail beyond the scope of this specification.
371   What matters to HTTP is how recipients of the Last-Modified
372   header field can use its value to make conditional requests
373   and test the validity of locally cached responses.
[1260]376   An origin server &SHOULD; obtain the Last-Modified value of the
[1740]377   representation as close as possible to the time that it generates the
378   <x:ref>Date</x:ref> field value for its response. This allows a recipient to
[1260]379   make an accurate assessment of the representation's modification time,
380   especially if the representation changes near the time that the
381   response is generated.
[1260]384   An origin server with a clock &MUST-NOT; send a Last-Modified date
[1740]385   that is later than the server's time of message origination (<x:ref>Date</x:ref>).
[1260]386   If the last modification time is derived from implementation-specific
387   metadata that evaluates to some time in the future, according to the
388   origin server's clock, then the origin server &MUST; replace that
389   value with the message origination date. This prevents a future
390   modification date from having an adverse impact on cache validation.
393   An origin server without a clock &MUST-NOT; assign Last-Modified
394   values to a response unless these values were associated
395   with the resource by some other system or user with a reliable clock.
[1260]399<section title="Comparison" anchor="lastmod.comparison">
[1260]401   A Last-Modified time, when used as a validator in a request, is
402   implicitly weak unless it is possible to deduce that it is strong,
403   using the following rules:
404  <list style="symbols">
405     <t>The validator is being compared by an origin server to the
406        actual current validator for the representation and,</t>
407     <t>That origin server reliably knows that the associated representation did
408        not change twice during the second covered by the presented
409        validator.</t>
410  </list>
[1260]413   or
414  <list style="symbols">
[1739]415     <t>The validator is about to be used by a client in an <x:ref>If-Modified-Since</x:ref>,
416        <x:ref>If-Unmodified-Since</x:ref> header field, because the client has
417        a cache entry, or <x:ref>If-Range</x:ref> for the associated
418        representation, and</t>
[1740]419     <t>That cache entry includes a <x:ref>Date</x:ref> value, which gives the
420        time when the origin server sent the original response, and</t>
[1260]421     <t>The presented Last-Modified time is at least 60 seconds before
422        the Date value.</t>
423  </list>
[1260]426   or
427  <list style="symbols">
428     <t>The validator is being compared by an intermediate cache to the
429        validator stored in its cache entry for the representation, and</t>
[1740]430     <t>That cache entry includes a <x:ref>Date</x:ref> value, which gives the
431        time when the origin server sent the original response, and</t>
[1260]432     <t>The presented Last-Modified time is at least 60 seconds before
433        the Date value.</t>
434  </list>
[1260]437   This method relies on the fact that if two different responses were
438   sent by the origin server during the same second, but both had the
439   same Last-Modified time, then at least one of those responses would
[1740]440   have a <x:ref>Date</x:ref> value equal to its Last-Modified time. The
441   arbitrary 60-second limit guards against the possibility that the Date and
442   Last-Modified values are generated from different clocks, or at somewhat
[1260]443   different times during the preparation of the response. An
444   implementation &MAY; use a value larger than 60 seconds, if it is
445   believed that 60 seconds is too short.
[1253]450<section title="ETag" anchor="header.etag">
451  <iref primary="true" item="ETag header field" x:for-anchor=""/>
452  <iref primary="true" item="Header Fields" subitem="ETag" x:for-anchor=""/>
453  <x:anchor-alias value="ETag"/>
[1260]454  <x:anchor-alias value="entity-tag"/>
455  <x:anchor-alias value="opaque-tag"/>
456  <x:anchor-alias value="weak"/>
[1470]457  <x:anchor-alias value="etagc"/>
[1772]459   The "ETag" header field provides the current entity-tag for the
[1260]460   selected representation.
461   An entity-tag is an opaque validator for differentiating between
462   multiple representations of the same resource, regardless of whether
463   those multiple representations are due to resource state changes over
464   time, content negotiation resulting in multiple representations being
465   valid at the same time, or both. An entity-tag consists of an opaque
466   quoted string, possibly prefixed by a weakness indicator.
[1470]468<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"/>
[1260]469  <x:ref>ETag</x:ref>       = <x:ref>entity-tag</x:ref>
471  <x:ref>entity-tag</x:ref> = [ <x:ref>weak</x:ref> ] <x:ref>opaque-tag</x:ref>
472  <x:ref>weak</x:ref>       = <x:abnf-char-sequence>"W/"</x:abnf-char-sequence> ; "W/", case-sensitive
[1470]473  <x:ref>opaque-tag</x:ref> = <x:ref>DQUOTE</x:ref> *<x:ref>etagc</x:ref> <x:ref>DQUOTE</x:ref>
474  <x:ref>etagc</x:ref>      = %x21 / %x23-7E / <x:ref>obs-text</x:ref>
[1482]475             ; <x:ref>VCHAR</x:ref> except double quotes, plus obs-text
478  <t>
[1692]479    &Note; Previously, opaque-tag was defined to be a quoted-string
[1470]480    (<xref target="RFC2616" x:fmt="," x:sec="3.11"/>), thus some recipients
481    might perform backslash unescaping. Servers therefore ought to avoid
482    backslash characters in entity tags.
483  </t>
486   An entity-tag can be more reliable for validation than a modification
487   date in situations where it is inconvenient to store modification
488   dates, where the one-second resolution of HTTP date values is not
489   sufficient, or where modification dates are not consistently maintained.
492  Examples:
494<artwork type="example">
495  ETag: "xyzzy"
496  ETag: W/"xyzzy"
497  ETag: ""
500   An entity-tag can be either a weak or strong validator, with
501   strong being the default.  If an origin server provides an entity-tag
502   for a representation and the generation of that entity-tag does not satisfy
503   the requirements for a strong validator
504   (<xref target="weak.and.strong.validators"/>), then that
505   entity-tag &MUST; be marked as weak by prefixing its opaque value
506   with "W/" (case-sensitive).
509<section title="Generation" anchor="entity.tag.generation">
511   The principle behind entity-tags is that only the service author
[1260]512   knows the implementation of a resource well enough to select the
513   most accurate and efficient validation mechanism for that resource,
514   and that any such mechanism can be mapped to a simple sequence of
515   octets for easy comparison.  Since the value is opaque, there is no
516   need for the client to be aware of how each entity-tag is constructed.
[1260]519   For example, a resource that has implementation-specific versioning
520   applied to all changes might use an internal revision number, perhaps
521   combined with a variance identifier for content negotiation, to
522   accurately differentiate between representations.
[1801]523   Other implementations might use a collision-resistant hash of
524   representation content,
[1260]525   a combination of various filesystem attributes, or a modification
526   timestamp that has sub-second resolution.
[1260]529   Origin servers &SHOULD; send ETag for any selected representation
530   for which detection of changes can be reasonably and consistently
531   determined, since the entity-tag's use in conditional requests and
532   evaluating cache freshness (&caching;) can result in a substantial
533   reduction of HTTP network traffic and can be a significant factor in
534   improving service scalability and reliability.
[1260]538<section title="Comparison" anchor="entity.tag.comparison">
539  <x:anchor-alias value="validator.comparison"/>
541   There are two entity-tag comparison functions, depending
[8]542   on whether the comparison context allows the use of weak validators
543   or not:
544  <list style="symbols">
545     <t>The strong comparison function: in order to be considered equal,
[298]546        both opaque-tags &MUST; be identical character-by-character, and both
547        &MUST-NOT; be weak.</t>
548     <t>The weak comparison function: in order to be considered equal, both
[610]549        opaque-tags &MUST; be identical character-by-character, but
550        either or both of them &MAY; be tagged as "weak" without affecting
551        the result.</t>
[8]552  </list>
[874]555   The example below shows the results for a set of entity-tag pairs,
[298]556   and both the weak and strong comparison function results:
558<texttable align="left">
559  <ttcol>ETag 1</ttcol>
560  <ttcol>ETag 2</ttcol>
561  <ttcol>Strong Comparison</ttcol>
562  <ttcol>Weak Comparison</ttcol>
564  <c>W/"1"</c>
565  <c>W/"1"</c>
566  <c>no match</c>
567  <c>match</c>
569  <c>W/"1"</c>
570  <c>W/"2"</c>
571  <c>no match</c>
572  <c>no match</c>
574  <c>W/"1"</c>
575  <c>"1"</c>
576  <c>no match</c>
577  <c>match</c>
579  <c>"1"</c>
580  <c>"1"</c>
581  <c>match</c>
582  <c>match</c>
586<section title="Example: Entity-tags varying on Content-Negotiated Resources" anchor="example.entity.tag.vs.conneg">
[1379]588   Consider a resource that is subject to content negotiation (&content-negotiation;),
589   and where the representations returned upon a GET request vary based on
[1740]590   the <x:ref>Accept-Encoding</x:ref> request header field
591   (&header-accept-encoding;):
[1379]593<figure><preamble>>> Request:</preamble><artwork type="message/http; msgtype=&#34;request&#34;"  x:indent-with="  ">
594GET /index HTTP/1.1
596Accept-Encoding: gzip
600   In this case, the response might or might not use the gzip content coding.
601   If it does not, the response might look like:
603<figure><preamble>>> Response:</preamble><artwork type="message/http; msgtype=&#34;response&#34;"  x:indent-with="  ">
604HTTP/1.1 200 OK
605Date: Thu, 26 Mar 2010 00:05:00 GMT
606ETag: "123-a"
607Content-Length: <x:length-of target="exbody"/>
608Vary: Accept-Encoding
609Content-Type: text/plain
611<x:span anchor="exbody">Hello World!
612Hello World!
613Hello World!
614Hello World!
615Hello World!
618   An alternative representation that does use gzip content coding would be:
620<figure><preamble>>> Response:</preamble><artwork type="message/http; msgtype=&#34;response&#34;"  x:indent-with="  ">
621HTTP/1.1 200 OK
622Date: Thu, 26 Mar 2010 00:05:00 GMT
623ETag: "123-b"
624Content-Length: 43
625Vary: Accept-Encoding
626Content-Type: text/plain
627Content-Encoding: gzip
629<spanx>...binary data...</spanx></artwork></figure>
631  <t>
[1692]632    &Note; Content codings are a property of the representation,
[1604]633    so therefore an entity-tag of an encoded representation has to be distinct
[1379]634    from an unencoded representation to prevent conflicts during cache updates
635    and range requests.  In contrast, transfer codings (&transfer-codings;)
636    apply only during message transfer and do not require distinct entity-tags.
637  </t>
[874]642<section title="Rules for When to Use Entity-tags and Last-Modified Dates" anchor="">
644   We adopt a set of rules and recommendations for origin servers,
645   clients, and caches regarding when various validator types ought to
646   be used, and for what purposes.
649   HTTP/1.1 origin servers:
650  <list style="symbols">
[874]651     <t>&SHOULD; send an entity-tag validator unless it is not feasible to
[8]652        generate one.</t>
[874]654     <t>&MAY; send a weak entity-tag instead of a strong entity-tag, if
655        performance considerations support the use of weak entity-tags,
656        or if it is unfeasible to send a strong entity-tag.</t>
[1739]658     <t>&SHOULD; send a <x:ref>Last-Modified</x:ref> value if it is feasible to
659        send one.</t>
[8]660  </list>
663   In other words, the preferred behavior for an HTTP/1.1 origin server
[1739]664   is to send both a strong entity-tag and a <x:ref>Last-Modified</x:ref> value.
667   HTTP/1.1 clients:
668  <list style="symbols">
[874]669     <t>&MUST; use that entity-tag in any cache-conditional request (using
[1739]670        <x:ref>If-Match</x:ref> or <x:ref>If-None-Match</x:ref>) if an
671        entity-tag has been provided by the origin server.</t>
[1739]673     <t>&SHOULD; use the <x:ref>Last-Modified</x:ref> value in non-subrange
674        cache-conditional requests (using <x:ref>If-Modified-Since</x:ref>)
675        if only a Last-Modified value has been provided by the origin server.</t>
[1739]677     <t>&MAY; use the <x:ref>Last-Modified</x:ref> value in subrange
678        cache-conditional requests (using <x:ref>If-Unmodified-Since</x:ref>)
679        if only a Last-Modified value has been provided by an HTTP/1.0 origin
680        server. The user agent &SHOULD; provide a way to disable this, in case
681        of difficulty.</t>
[755]683     <t>&SHOULD; use both validators in cache-conditional requests if both an
[1739]684        entity-tag and a <x:ref>Last-Modified</x:ref> value have been provided
685        by the origin server. This allows both HTTP/1.0 and HTTP/1.1 caches to
686        respond appropriately.</t>
[8]687  </list>
690   An HTTP/1.1 origin server, upon receiving a conditional request that
[1739]691   includes both a Last-Modified date (e.g., in an <x:ref>If-Modified-Since</x:ref>
692   or <x:ref>If-Unmodified-Since</x:ref> header field) and one or more
693   entity-tags (e.g., in an <x:ref>If-Match</x:ref>, <x:ref>If-None-Match</x:ref>,
694   or <x:ref>If-Range</x:ref> header field) as cache validators, &MUST-NOT;
695   return a response status code of <x:ref>304 (Not Modified)</x:ref> unless
696   doing so is consistent with all of the conditional header fields in the
697   request.
700   An HTTP/1.1 caching proxy, upon receiving a conditional request that
[874]701   includes both a Last-Modified date and one or more entity-tags as
[8]702   cache validators, &MUST-NOT; return a locally cached response to the
703   client unless that cached response is consistent with all of the
704   conditional header fields in the request.
705  <list><t>
[1692]706      &Note; The general principle behind these rules is that HTTP/1.1
[969]707      servers and clients ought to transmit as much non-redundant
[8]708      information as is available in their responses and requests.
709      HTTP/1.1 systems receiving this information will make the most
710      conservative assumptions about the validators they receive.
711  </t><t>
[1107]712      HTTP/1.0 clients and caches might ignore entity-tags. Generally,
[8]713      last-modified values received or used by these systems will
714      support transparent and efficient caching, and so HTTP/1.1 origin
[1703]715      servers still ought to provide Last-Modified values.
[8]716  </t></list>
[1415]721<section title="Precondition Header Fields" anchor="header.field.definitions">
[117]723   This section defines the syntax and semantics of HTTP/1.1 header fields
[1253]724   for applying preconditions on requests.
[1799]725   <xref target="precedence"/> defines the order of evaluation when
726   more than one precondition is present in a request.
729<section title="If-Match" anchor="header.if-match">
[1120]730  <iref primary="true" item="If-Match header field" x:for-anchor=""/>
731  <iref primary="true" item="Header Fields" subitem="If-Match" x:for-anchor=""/>
[229]732  <x:anchor-alias value="If-Match"/>
[1757]734   The "If-Match" header field can be used to make a request method conditional
735   on the current existence or value of an entity-tag for one or more
736   representations of the target resource.
739   If-Match is generally useful for resource update requests, such as PUT
740   requests, as a means for protecting against accidental overwrites when
741   multiple clients are acting in parallel on the same resource (i.e., the
[1223]742   "lost update" problem).  An If-Match field-value of "*" places the
743   precondition on the existence of any current representation for the
744   target resource.
[1233]746<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Match"/>
747  <x:ref>If-Match</x:ref> = "*" / 1#<x:ref>entity-tag</x:ref>
[1761]750   The If-Match condition is met if and only if any of the entity-tags listed
751   in the If-Match field value match the entity-tag of the selected
752   representation for the target resource (as per <xref
753   target="entity.tag.comparison"/>), or if "*" is given and any current
754   representation exists for the target resource.
[1761]757   If the condition is met, the server &MAY; perform the request method as if
758   the If-Match header field was not present.
[1761]761   Origin servers &MUST-NOT; perform the requested method if the condition is
762   not met; instead they &MUST; respond with the <x:ref>412 (Precondition
763   Failed)</x:ref> status code.
[1696]766   Proxy servers using a cached response as the selected representation
[1761]767   &MUST-NOT; perform the requested method if the condition is not met;
768   instead, they &MUST; forward the request towards the origin server.
[8]771   If the request would, without the If-Match header field, result in
[1734]772   anything other than a <x:ref>2xx (Successful)</x:ref> or <x:ref>412 (Precondition Failed)</x:ref>
773   status code, then the If-Match header field &MUST; be ignored.
776   Examples:
778<figure><artwork type="example">
[362]779  If-Match: "xyzzy"
780  If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
781  If-Match: *
[1253]785<section title="If-None-Match" anchor="header.if-none-match">
786  <iref primary="true" item="If-None-Match header field" x:for-anchor=""/>
787  <iref primary="true" item="Header Fields" subitem="If-None-Match" x:for-anchor=""/>
788  <x:anchor-alias value="If-None-Match"/>
[1691]790   The "If-None-Match" header field can be used to make a request method
[1253]791   conditional on not matching any of the current entity-tag values for
[1757]792   representations of the target resource.
[1757]795   If-None-Match is primarily used in conditional GET requests to enable
796   efficient updates of cached information with a minimum amount of transaction
797   overhead. A client that has one or more representations previously obtained
798   from the target resource can send If-None-Match with a list of the
799   associated entity-tags in the hope of receiving a <x:ref>304 (Not
800   Modified)</x:ref> response if at least one of those representations matches
801   the selected representation.
[1691]804   If-None-Match can also be used with a value of "*" to prevent an unsafe
[1253]805   request method (e.g., PUT) from inadvertently modifying an existing
806   representation of the target resource when the client believes that
807   the resource does not have a current representation.  This is a variation
808   on the "lost update" problem that might arise if more than one client
809   attempts to create an initial representation for the target resource.
811<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-None-Match"/>
812  <x:ref>If-None-Match</x:ref> = "*" / 1#<x:ref>entity-tag</x:ref>
[1761]815   The If-None-Match condition is met if and only if none of the entity-tags
816   listed in the If-None-Match field value match the entity-tag of the selected
817   representation for the target resource (as per <xref
818   target="entity.tag.comparison"/>), or if "*" is given and no current
819   representation exists for that resource.
[1761]822   If the condition is not met, the server &MUST-NOT; perform the requested
823   method. Instead, if the request method was GET or HEAD, the server &SHOULD;
824   respond with a <x:ref>304 (Not Modified)</x:ref> status code, including the
825   cache-related header fields (particularly <x:ref>ETag</x:ref>) of the
826   selected representation that has a matching entity-tag. For all other
827   request methods, the server &MUST; respond with a <x:ref>412 (Precondition
828   Failed)</x:ref> status code.
[1761]831   If the condition is met, the server &MAY; perform the requested method
832   as if the If-None-Match header field did not exist, but &MUST; also ignore
833   any <x:ref>If-Modified-Since</x:ref> header field(s) in the request. That
834   is, if no entity-tags match, then the server &MUST-NOT; return a <x:ref>304
835   (Not Modified)</x:ref> response.
[1253]838   If the request would, without the If-None-Match header field, result
[1734]839   in anything other than a <x:ref>2xx (Successful)</x:ref> or
840   <x:ref>304 (Not Modified)</x:ref> status code, then the If-None-Match
[1253]841   header field &MUST; be ignored. (See <xref
842   target=""/> for
[1739]843   a discussion of server behavior when both <x:ref>If-Modified-Since</x:ref>
844   and If-None-Match appear in the same request.)
847   Examples:
849<figure><artwork type="example">
850  If-None-Match: "xyzzy"
851  If-None-Match: W/"xyzzy"
852  If-None-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
853  If-None-Match: W/"xyzzy", W/"r2d2xxxx", W/"c3piozzzz"
854  If-None-Match: *
[8]858<section title="If-Modified-Since" anchor="header.if-modified-since">
[1120]859  <iref primary="true" item="If-Modified-Since header field" x:for-anchor=""/>
860  <iref primary="true" item="Header Fields" subitem="If-Modified-Since" x:for-anchor=""/>
[229]861  <x:anchor-alias value="If-Modified-Since"/>
[1799]863   The "If-Modified-Since" header field can be used with GET or HEAD to make
864   the method conditional by modification date: if the selected representation
[1223]865   has not been modified since the time specified in this field, then
866   do not perform the request method; instead, respond as detailed below.
[1233]868<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Modified-Since"/>
869  <x:ref>If-Modified-Since</x:ref> = <x:ref>HTTP-date</x:ref>
872   An example of the field is:
874<figure><artwork type="example">
[362]875  If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
[1738]878   A GET method with an If-Modified-Since header field and no <x:ref>Range</x:ref>
879   header field requests that the selected representation be transferred only if
[1223]880   it has been modified since the date given by the If-Modified-Since
881   header field.
[8]882   The algorithm for determining this includes the following cases:
883  <list style="numbers">
884      <t>If the request would normally result in anything other than a
[1715]885         <x:ref>200 (OK)</x:ref> status code, or if the passed If-Modified-Since date is
[8]886         invalid, the response is exactly the same as for a normal GET.
887         A date which is later than the server's current time is
888         invalid.</t>
[1223]890      <t>If the selected representation has been modified since the
891         If-Modified-Since date, the response is exactly the same as for
892         a normal GET.</t>
[1223]894      <t>If the selected representation has not been modified since a valid
[860]895         If-Modified-Since date, the server &SHOULD; return a
[1708]896         <x:ref>304 (Not Modified)</x:ref> response.</t>
[8]897  </list>
900   The purpose of this feature is to allow efficient updates of cached
901   information with a minimum amount of transaction overhead.
902  <list><t>
[1738]903      &Note; The <x:ref>Range</x:ref> header field modifies the meaning of
904      If-Modified-Since; see &header-range; for full details.
[8]905    </t><t>
[1692]906      &Note; If-Modified-Since times are interpreted by the server, whose
[8]907      clock might not be synchronized with the client.
908    </t><t>
[1692]909      &Note; When handling an If-Modified-Since header field, some
[8]910      servers will use an exact date comparison function, rather than a
[1708]911      less-than function, for deciding whether to send a <x:ref>304 (Not Modified)</x:ref>
912      response. To get best results when sending an If-Modified-Since
[8]913      header field for cache validation, clients are
[1739]914      advised to use the exact date string received in a previous
915      <x:ref>Last-Modified</x:ref> header field whenever possible.
[8]916    </t><t>
[1692]917      &Note; If a client uses an arbitrary date in the If-Modified-Since
[1739]918      header field instead of a date taken from the <x:ref>Last-Modified</x:ref>
919      header field for the same request, the client needs to be aware that this
[969]920      date is interpreted in the server's understanding of time.
921      Unsynchronized clocks and rounding problems, due to the different
922      encodings of time between the client and server, are concerns.
923      This includes the possibility of race conditions if the
[8]924      document has changed between the time it was first requested and
925      the If-Modified-Since date of a subsequent request, and the
926      possibility of clock-skew-related problems if the If-Modified-Since
927      date is derived from the client's clock without correction
928      to the server's clock. Corrections for different time bases
929      between client and server are at best approximate due to network
930      latency.
931    </t>
932  </list>
936<section title="If-Unmodified-Since" anchor="header.if-unmodified-since">
[1120]937  <iref primary="true" item="If-Unmodified-Since header field" x:for-anchor=""/>
938  <iref primary="true" item="Header Fields" subitem="If-Unmodified-Since" x:for-anchor=""/>
[229]939  <x:anchor-alias value="If-Unmodified-Since"/>
[1691]941   The "If-Unmodified-Since" header field can be used to make a request
[1223]942   method conditional by modification date: if the selected representation
943   has been modified since the time specified in this field, then the
944   server &MUST-NOT; perform the requested operation and &MUST; instead
[1708]945   respond with the <x:ref>412 (Precondition Failed)</x:ref> status code.
[1223]946   If the selected representation has not been modified since the time
947   specified in this field, the server &SHOULD; perform the request
948   method as if the If-Unmodified-Since header field were not present.
[1233]950<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Unmodified-Since"/>
951  <x:ref>If-Unmodified-Since</x:ref> = <x:ref>HTTP-date</x:ref>
954   An example of the field is:
956<figure><artwork type="example">
[362]957  If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT
[1691]960   If a request normally (i.e., in absence of the If-Unmodified-Since
[1734]961   header field) would result in anything other than a <x:ref>2xx (Successful)</x:ref>
962   or <x:ref>412 (Precondition Failed)</x:ref> status code,
[994]963   the If-Unmodified-Since header field &SHOULD; be ignored.
[1223]966   If the specified date is invalid, the header field &MUST; be ignored.
[1260]970<section title="If-Range" anchor="header.if-range">
[1738]972   The "If-Range" header field provides a special conditional request
[1739]973   mechanism that is similar to <x:ref>If-Match</x:ref> and
974   <x:ref>If-Unmodified-Since</x:ref> but specific to HTTP range requests.
975   If-Range is defined in &header-if-range;.
[1253]981<section title="Status Code Definitions" anchor="status.code.definitions">
982<section title="304 Not Modified" anchor="status.304">
983  <iref primary="true" item="304 Not Modified (status code)" x:for-anchor=""/>
984  <iref primary="true" item="Status Codes" subitem="304 Not Modified" x:for-anchor=""/>
[1734]985  <x:anchor-alias value="304"/>
[1708]986  <x:anchor-alias value="304 (Not Modified)"/>
[1253]988   The 304 status code indicates that a conditional GET request has been
[1715]989   received and would have resulted in a <x:ref>200 (OK)</x:ref> response if it were not
[1253]990   for the fact that the condition has evaluated to false.  In other words,
991   there is no need for the server to transfer a representation of the
992   target resource because the client's request indicates that it already
993   has a valid representation, as indicated by the 304 response header
994   fields, and is therefore redirecting the client to make use of that
995   stored representation as if it were the payload of a 200 response.
996   The 304 response &MUST-NOT; contain a message-body, and thus is always
997   terminated by the first empty line after the header fields.
[1740]1000   A 304 response &MUST; include a <x:ref>Date</x:ref> header field
1001   (&header-date;) unless the origin server does not have a clock that can
1002   provide a reasonable approximation of the current time.  If a <x:ref>200
1003   (OK)</x:ref> response to the same request would have included any of the
1004   header fields <x:ref>Cache-Control</x:ref>, <x:ref>Content-Location</x:ref>,
1005   <x:ref>ETag</x:ref>, <x:ref>Expires</x:ref>, or <x:ref>Vary</x:ref>, then
1006   those same header fields &MUST; be sent in a 304 response.
[1253]1009   Since the goal of a 304 response is to minimize information transfer
1010   when the recipient already has one or more cached representations,
1011   the response &SHOULD-NOT; include representation metadata other
1012   than the above listed fields unless said metadata exists for the
1013   purpose of guiding cache updates (e.g., future HTTP extensions).
[1253]1016   If the recipient of a 304 response does not have a cached representation
1017   corresponding to the entity-tag indicated by the 304 response, then the
1018   recipient &MUST-NOT; use the 304 to update its own cache.  If this
[1758]1019   conditional request originated with an outbound client, such as a user agent
1020   with its own cache sending a conditional GET to a shared proxy, then the 304
1021   response &MAY; be forwarded to that client.  Otherwise, the recipient &MUST;
1022   disregard the 304 response and repeat the request without any preconditions.
[1253]1025   If a cache uses a received 304 response to update a cache entry, the
1026   cache &MUST; update the entry to reflect any new field values given in
1027   the response.
1031<section title="412 Precondition Failed" anchor="status.412">
1032  <iref primary="true" item="412 Precondition Failed (status code)" x:for-anchor=""/>
1033  <iref primary="true" item="Status Codes" subitem="412 Precondition Failed" x:for-anchor=""/>
[1708]1034  <x:anchor-alias value="412 (Precondition Failed)"/>
[1253]1036   The 412 status code indicates that one or more preconditions given in
1037   the request header fields evaluated to false when tested on the server.
1038   This response code allows the client to place preconditions on the
1039   current resource state (its current representations and metadata)
1040   and thus prevent the request method from being applied if the target
1041   resource is in an unexpected state.
[1799]1046<section title="Precedence" anchor="precedence">
1048   When more than one conditional request header field is present in a request,
1049   the order in which the fields are evaluated becomes important. In practice,
1050   the fields defined in this document are consistently implemented in a
1051   single, logical order, due to the fact that entity tags are presumed to be
1052   more accurate than date validators. For example, the only reason to send
1053   both <x:ref>If-Modified-Since</x:ref> and <x:ref>If-None-Match</x:ref> in the same GET request is to
1054   support intermediary caches that might not have implemented <x:ref>If-None-Match</x:ref>,
1055   so it makes sense to ignore the <x:ref>If-Modified-Since</x:ref> when entity tags are
1056   understood and available for the selected representation.
1059   The general rule of conditional precedence is that exact match conditions
1060   are evaluated before cache-validating conditions and, within that order,
1061   last-modified conditions are only evaluated if the corresponding
1062   entity tag condition is not present (or not applicable because the
1063   selected representation does not have an entity tag).
1066   Specifically, the fields defined by this specification are evaluated
1067   as follows:
1068   <list style="numbers">
1069     <t>When <x:ref>If-Match</x:ref> is present, evaluate it:
1070       <list style="symbols">
1071         <t>if true, continue to step 3</t>
1072         <t>if false, respond <x:ref>412 (Precondition Failed)</x:ref></t>
1073       </list>
1074     </t>
1075     <t>When <x:ref>If-Match</x:ref> is not present and
1076        <x:ref>If-Unmodified-Since</x:ref> is present, evaluate it:
1077       <list style="symbols">
1078         <t>if true, continue to step 3</t>
1079         <t>if false, respond <x:ref>412 (Precondition Failed)</x:ref></t>
1080       </list>
1081     </t>
1082     <t>When the method is GET and both <x:ref>Range</x:ref> and
1083        <x:ref>If-Range</x:ref> are present, evaluate it:
1084       <list style="symbols">
[1801]1085         <t>if the validator matches, respond 206 (Partial Content)</t>
[1799]1086         <t>if the validator does not match, respond <x:ref>200 (OK)</x:ref></t>
1087       </list>
1088     </t>
1089     <t>When <x:ref>If-None-Match</x:ref> is present, evaluate it:
1090       <list style="symbols">
1091         <t>if true, all conditions are met</t>
1092         <t>if false for GET/HEAD, respond <x:ref>304 (Not Modified)</x:ref></t>
1093         <t>if false for other methods, respond <x:ref>412 (Precondition Failed)</x:ref></t>
1094       </list>
1095     </t>
1096     <t>When the method is GET or HEAD,
1097        <x:ref>If-None-Match</x:ref> is not present, and
1098        <x:ref>If-Modified-Since</x:ref> is present, evaluate it:
1099       <list style="symbols">
1100         <t>if true, all conditions are met</t>
1101         <t>if false, respond <x:ref>304 (Not Modified)</x:ref></t>
1102       </list>
1103     </t>
1104   </list>
1107   Any extension to HTTP/1.1 that defines additional conditional request
1108   header fields ought to define its own expectations regarding the order
1109   for evaluating such fields in relation to those defined in this document
1110   and other conditionals that might be found in practice.
[29]1114<section title="IANA Considerations" anchor="IANA.considerations">
1116<section title="Status Code Registration" anchor="status.code.registration">
1118   The HTTP Status Code Registry located at <eref target=""/>
[969]1119   shall be updated with the registrations below:
1121<?BEGININC p4-conditional.iana-status-codes ?>
1122<!--AUTOGENERATED FROM extract-status-code-defs.xslt, do not edit manually-->
1123<texttable align="left" suppress-title="true" anchor="iana.status.code.registration.table">
1124   <ttcol>Value</ttcol>
1125   <ttcol>Description</ttcol>
1126   <ttcol>Reference</ttcol>
1127   <c>304</c>
1128   <c>Not Modified</c>
1129   <c>
1130      <xref target="status.304"/>
1131   </c>
1132   <c>412</c>
1133   <c>Precondition Failed</c>
1134   <c>
1135      <xref target="status.412"/>
1136   </c>
1139<?ENDINC p4-conditional.iana-status-codes ?>
[921]1142<section title="Header Field Registration" anchor="header.field.registration">
[969]1144   The Message Header Field Registry located at <eref target=""/> shall be updated
[290]1145   with the permanent registrations below (see <xref target="RFC3864"/>):
[680]1147<?BEGININC p4-conditional.iana-headers ?>
[253]1148<!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually-->
[290]1149<texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
[253]1150   <ttcol>Header Field Name</ttcol>
1151   <ttcol>Protocol</ttcol>
1152   <ttcol>Status</ttcol>
1153   <ttcol>Reference</ttcol>
1155   <c>ETag</c>
1156   <c>http</c>
1157   <c>standard</c>
1158   <c>
1159      <xref target="header.etag"/>
1160   </c>
1161   <c>If-Match</c>
1162   <c>http</c>
1163   <c>standard</c>
1164   <c>
1165      <xref target="header.if-match"/>
1166   </c>
1167   <c>If-Modified-Since</c>
1168   <c>http</c>
1169   <c>standard</c>
1170   <c>
1171      <xref target="header.if-modified-since"/>
1172   </c>
1173   <c>If-None-Match</c>
1174   <c>http</c>
1175   <c>standard</c>
1176   <c>
1177      <xref target="header.if-none-match"/>
1178   </c>
1179   <c>If-Unmodified-Since</c>
1180   <c>http</c>
1181   <c>standard</c>
1182   <c>
1183      <xref target="header.if-unmodified-since"/>
1184   </c>
1185   <c>Last-Modified</c>
1186   <c>http</c>
1187   <c>standard</c>
1188   <c>
1189      <xref target="header.last-modified"/>
1190   </c>
[680]1193<?ENDINC p4-conditional.iana-headers ?>
[290]1195   The change controller is: "IETF ( - Internet Engineering Task Force".
1200<section title="Security Considerations" anchor="security.considerations">
[29]1202   No additional security considerations have been identified beyond
1203   those applicable to HTTP in general &messaging;.
1206   The validators defined by this specification are not intended to ensure
1207   the validity of a representation, guard against malicious changes, or
1208   detect man-in-the-middle attacks. At best, they enable more efficient cache
1209   updates and optimistic concurrent writes when all participants are behaving
1210   nicely. At worst, the conditions will fail and the client will receive a
1211   response that is no more harmful than an HTTP exchange without conditional
1212   requests.
[1364]1216<section title="Acknowledgments" anchor="acks">
1218  See &acks;.
1224<references title="Normative References">
[31]1226<reference anchor="Part1">
[119]1227  <front>
[1803]1228    <title>HTTP/1.1, part 1: Message Routing and Syntax"</title>
[119]1229    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
[1106]1230      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
[119]1231      <address><email></email></address>
1232    </author>
1233    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1234      <organization abbrev="W3C">World Wide Web Consortium</organization>
1235      <address><email></email></address>
1236    </author>
1237    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1238      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1239      <address><email></email></address>
1240    </author>
1241    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1242  </front>
1243  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"/>
1244  <x:source href="p1-messaging.xml" basename="p1-messaging"/>
[1436]1247<reference anchor="Part2">
1248  <front>
[1803]1249    <title>HTTP/1.1, part 2: Semantics and Payloads</title>
[1436]1250    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1251      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
1252      <address><email></email></address>
1253    </author>
1254    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1255      <organization abbrev="W3C">World Wide Web Consortium</organization>
1256      <address><email></email></address>
1257    </author>
1258    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1259      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1260      <address><email></email></address>
1261    </author>
1262    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1263  </front>
1264  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p2-semantics-&ID-VERSION;"/>
[1715]1265  <x:source href="p2-semantics.xml" basename="p2-semantics">
[1727]1266    <x:defines>2xx</x:defines>
[1734]1267    <x:defines>2xx (Successful)</x:defines>
[1715]1268    <x:defines>200 (OK)</x:defines>
[1740]1269    <x:defines>Accept-Encoding</x:defines>
1270    <x:defines>Content-Location</x:defines>
1271    <x:defines>Content-Type</x:defines>
1272    <x:defines>Date</x:defines>
1273    <x:defines>Location</x:defines>
[1715]1274  </x:source>
[31]1277<reference anchor="Part5">
[119]1278  <front>
[1803]1279    <title>HTTP/1.1, part 5: Range Requests</title>
[119]1280    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
[1106]1281      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
[119]1282      <address><email></email></address>
1283    </author>
1284    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1285      <organization abbrev="W3C">World Wide Web Consortium</organization>
1286      <address><email></email></address>
1287    </author>
1288    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1289      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1290      <address><email></email></address>
1291    </author>
1292    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1293  </front>
1294  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p5-range-&ID-VERSION;"/>
[1738]1295  <x:source href="p5-range.xml" basename="p5-range">
1296    <x:defines>If-Range</x:defines>
1297    <x:defines>Range</x:defines>
1298  </x:source>
1301<reference anchor="Part6">
[119]1302  <front>
[1726]1303    <title>HTTP/1.1, part 6: Caching</title>
[119]1304    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
[1106]1305      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
[119]1306      <address><email></email></address>
1307    </author>
1308    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1309      <organization abbrev="W3C">World Wide Web Consortium</organization>
1310      <address><email></email></address>
1311    </author>
[601]1312    <author initials="M." surname="Nottingham" fullname="Mark Nottingham" role="editor">
[1440]1313      <organization>Rackspace</organization>
[601]1314      <address><email></email></address>
1315    </author>
[119]1316    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1317      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1318      <address><email></email></address>
1319    </author>
1320    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1321  </front>
1322  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-&ID-VERSION;"/>
[1737]1323  <x:source href="p6-cache.xml" basename="p6-cache">
[1739]1324    <x:defines>Cache-Control</x:defines>
[1737]1325    <x:defines>Expires</x:defines>
1326    <x:defines>Vary</x:defines>
1327  </x:source>
[96]1330<reference anchor="RFC2119">
1331  <front>
1332    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
1333    <author initials="S." surname="Bradner" fullname="Scott Bradner">
1334      <organization>Harvard University</organization>
1335      <address><email></email></address>
1336    </author>
1337    <date month="March" year="1997"/>
1338  </front>
1339  <seriesInfo name="BCP" value="14"/>
1340  <seriesInfo name="RFC" value="2119"/>
[425]1343<reference anchor="RFC5234">
1344  <front>
1345    <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title>
1346    <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor">
1347      <organization>Brandenburg InternetWorking</organization>
1348      <address>
[728]1349        <email></email>
1350      </address> 
[425]1351    </author>
1352    <author initials="P." surname="Overell" fullname="Paul Overell">
1353      <organization>THUS plc.</organization>
1354      <address>
[728]1355        <email></email>
1356      </address>
[425]1357    </author>
1358    <date month="January" year="2008"/>
1359  </front>
1360  <seriesInfo name="STD" value="68"/>
1361  <seriesInfo name="RFC" value="5234"/>
1366<references title="Informative References">
1368<reference anchor="RFC2616">
1369  <front>
1370    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
1371    <author initials="R." surname="Fielding" fullname="R. Fielding">
1372      <organization>University of California, Irvine</organization>
1373      <address><email></email></address>
1374    </author>
1375    <author initials="J." surname="Gettys" fullname="J. Gettys">
1376      <organization>W3C</organization>
1377      <address><email></email></address>
1378    </author>
1379    <author initials="J." surname="Mogul" fullname="J. Mogul">
1380      <organization>Compaq Computer Corporation</organization>
1381      <address><email></email></address>
1382    </author>
1383    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
1384      <organization>MIT Laboratory for Computer Science</organization>
1385      <address><email></email></address>
1386    </author>
1387    <author initials="L." surname="Masinter" fullname="L. Masinter">
1388      <organization>Xerox Corporation</organization>
1389      <address><email></email></address>
1390    </author>
1391    <author initials="P." surname="Leach" fullname="P. Leach">
1392      <organization>Microsoft Corporation</organization>
1393      <address><email></email></address>
1394    </author>
1395    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
1396      <organization>W3C</organization>
1397      <address><email></email></address>
1398    </author>
1399    <date month="June" year="1999"/>
1400  </front>
1401  <seriesInfo name="RFC" value="2616"/>
[253]1404<reference anchor='RFC3864'>
1405  <front>
1406    <title>Registration Procedures for Message Header Fields</title>
1407    <author initials='G.' surname='Klyne' fullname='G. Klyne'>
1408      <organization>Nine by Nine</organization>
1409      <address><email></email></address>
1410    </author>
1411    <author initials='M.' surname='Nottingham' fullname='M. Nottingham'>
1412      <organization>BEA Systems</organization>
1413      <address><email></email></address>
1414    </author>
1415    <author initials='J.' surname='Mogul' fullname='J. Mogul'>
1416      <organization>HP Labs</organization>
1417      <address><email></email></address>
1418    </author>
1419    <date year='2004' month='September' />
1420  </front>
1421  <seriesInfo name='BCP' value='90' />
1422  <seriesInfo name='RFC' value='3864' />
[1251]1425<reference anchor='RFC4918'>
1426  <front>
1427    <title>HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)</title>
1428    <author initials="L.M." surname="Dusseault" fullname="Lisa Dusseault" role="editor" >
1429      <organization abbrev="CommerceNet">CommerceNet</organization>
1430      <address><email></email></address>
1431    </author>
1432    <date month="June" year="2007" />
1433  </front>
1434  <seriesInfo name='RFC' value='4918' />
1438<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
[874]1440  Allow weak entity-tags in all requests except range requests (Sections
[245]1441  <xref target="weak.and.strong.validators" format="counter"/> and
1442  <xref target="header.if-none-match" format="counter"/>).
[1739]1445  Change <x:ref>ETag</x:ref> header field ABNF not to use quoted-string, thus
1446  avoiding escaping issues.
[1470]1447  (<xref target="header.etag"/>)
[1233]1450  Change ABNF productions for header fields to only define the field value.
[1415]1451  (<xref target="header.field.definitions"/>)
[1805]1455<section title="Imported ABNF" anchor="imported.abnf">
1456  <x:anchor-alias value="ALPHA"/>
1457  <x:anchor-alias value="CR"/>
1458  <x:anchor-alias value="DIGIT"/>
1459  <x:anchor-alias value="DQUOTE"/>
1460  <x:anchor-alias value="LF"/>
1461  <x:anchor-alias value="OCTET"/>
1462  <x:anchor-alias value="VCHAR"/>
1463  <x:anchor-alias value="core.rules"/>
1464  <x:anchor-alias value="obs-text"/>
1465  <x:anchor-alias value="OWS"/>
1466  <x:anchor-alias value="HTTP-date"/>
1468  The following core rules are included by
[1806]1469  reference, as defined in <xref target="RFC5234" x:fmt="of" x:sec="B.1"/>:
[1805]1470  ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls),
1471  DIGIT (decimal 0-9), DQUOTE (double quote),
1472  HEXDIG (hexadecimal 0-9/A-F/a-f), LF (line feed),
1473  OCTET (any 8-bit sequence of data), SP (space), and
1474  VCHAR (any visible US-ASCII character).
1477  The rules below are defined in <xref target="Part1"/>:
1479<figure><artwork type="abnf2616">
1480  <x:ref>OWS</x:ref>           = &lt;OWS, defined in &whitespace;&gt;
1481  <x:ref>obs-text</x:ref>      = &lt;obs-text, defined in &field-components;&gt;
1484  The rules below are defined in other parts:
1486<figure><artwork type="abnf2616">
1487  <x:ref>HTTP-date</x:ref>     = &lt;HTTP-date, defined in &http-date;&gt;
[680]1491<?BEGININC p4-conditional.abnf-appendix ?>
[427]1492<section xmlns:x="" title="Collected ABNF" anchor="collected.abnf">
1494<artwork type="abnf" name="p4-conditional.parsed-abnf">
[1233]1495<x:ref>ETag</x:ref> = entity-tag
[1663]1497<x:ref>HTTP-date</x:ref> = &lt;HTTP-date, defined in [Part2], Section 5.1&gt;
[1233]1499<x:ref>If-Match</x:ref> = "*" / ( *( "," OWS ) entity-tag *( OWS "," [ OWS
[427]1500 entity-tag ] ) )
[1233]1501<x:ref>If-Modified-Since</x:ref> = HTTP-date
1502<x:ref>If-None-Match</x:ref> = "*" / ( *( "," OWS ) entity-tag *( OWS "," [ OWS
[427]1503 entity-tag ] ) )
[1233]1504<x:ref>If-Unmodified-Since</x:ref> = HTTP-date
[1233]1506<x:ref>Last-Modified</x:ref> = HTTP-date
[1523]1508<x:ref>OWS</x:ref> = &lt;OWS, defined in [Part1], Section 3.2.1&gt;
1510<x:ref>entity-tag</x:ref> = [ weak ] opaque-tag
[1470]1511<x:ref>etagc</x:ref> = "!" / %x23-7E ; '#'-'~'
1512 / obs-text
[1523]1514<x:ref>obs-text</x:ref> = &lt;obs-text, defined in [Part1], Section 3.2.4&gt;
[1470]1515<x:ref>opaque-tag</x:ref> = DQUOTE *etagc DQUOTE
[581]1517<x:ref>weak</x:ref> = %x57.2F ; W/
[680]1521<?ENDINC p4-conditional.abnf-appendix ?>
[252]1523<section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log">
[1624]1525  Changes up to the first Working Group Last Call draft are summarized
1526  in <eref target=""/>.
[1592]1529<section title="Since draft-ietf-httpbis-p4-conditional-19" anchor="changes.since.19">
[1682]1531  Closed issues:
1532  <list style="symbols">
1533    <t>
[1800]1534      <eref target=""/>:
1535      "Need to clarify eval order/interaction of conditional headers"
1536    </t>
1537    <t>
[1819]1538      <eref target=""/>:
1539      "Required headers on 304 and 206"
1540    </t>
1541    <t>
1542      <eref target=""/>:
1543      "Optionality of Conditional Request Support"
1544    </t>
1545    <t>
[1696]1546      <eref target=""/>:
1547      "ETags and Conditional Requests"
1548    </t>
1549    <t>
[1682]1550      <eref target=""/>:
1551      "ABNF requirements for recipients"
1552    </t>
[1703]1553    <t>
1554      <eref target=""/>:
1555      "Rare cases"
1556    </t>
[1761]1557    <t>
[1802]1558      <eref target=""/>:
1559      "Conditional Request Security Considerations"
1560    </t>
1561    <t>
[1800]1562      <eref target=""/>:
1563      "If-Modified-Since lacks definition for method != GET"
1564    </t>
1565    <t>
[1761]1566      <eref target=""/>:
1567      "refactor conditional header field descriptions"
1568    </t>
[1682]1569  </list>
[1807]1573<section title="Since draft-ietf-httpbis-p4-conditional-20" anchor="changes.since.20">
1575  None yet.
Note: See TracBrowser for help on using the repository browser.