source: draft-ietf-httpbis/latest/auth48/rfc7232-to-be.xml @ 2668

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

add RFC7232-to-be (#553)

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