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

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

Cleanup "Changes from RFC 2616" sections.

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