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

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

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

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