source: draft-ietf-httpbis/24/draft-ietf-httpbis-p4-conditional-24.txt @ 2656

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

Prepare release of -24 on Sept 25

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