source: draft-ietf-httpbis/latest/auth48/p4-conditional.unpg.txt @ 2670

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

grammar (#553)

File size: 55.9 KB
Line 
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: November 15, 2014                                  May 14, 2014
9
10
11      Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests
12                draft-ietf-httpbis-p4-conditional-latest
13
14Abstract
15
16   The Hypertext Transfer Protocol (HTTP) is a stateless application-
17   level 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   _This is a temporary document for the purpose of tracking the
36   editorial changes made during the AUTH48 (RFC publication) phase._
37
38Status of This Memo
39
40   This Internet-Draft is submitted in full conformance with the
41   provisions of BCP 78 and BCP 79.
42
43   Internet-Drafts are working documents of the Internet Engineering
44   Task Force (IETF).  Note that other groups may also distribute
45   working documents as Internet-Drafts.  The list of current Internet-
46   Drafts is at http://datatracker.ietf.org/drafts/current/.
47
48   Internet-Drafts are draft documents valid for a maximum of six months
49   and may be updated, replaced, or obsoleted by other documents at any
50   time.  It is inappropriate to use Internet-Drafts as reference
51   material or to cite them other than as "work in progress."
52
53
54
55Fielding & Reschke      Expires November 15, 2014               [Page 1]
56
57Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
58
59
60   This Internet-Draft will expire on November 15, 2014.
61
62Copyright Notice
63
64   Copyright (c) 2014 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 November 15, 2014               [Page 2]
112
113Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
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   Index  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
155
156
157
158
159
160
161
162
163
164
165
166
167Fielding & Reschke      Expires November 15, 2014               [Page 3]
168
169Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
170
171
1721.  Introduction
173
174   Conditional requests are HTTP requests [RFC7231] 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   [RFC7230].
180
181   Conditional GET requests are the most efficient mechanism for HTTP
182   cache updates [RFC7234].  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 [RFC7231]) 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 [RFC7230].
211
2121.2.  Syntax Notation
213
214   This specification uses the Augmented Backus-Naur Form (ABNF)
215   notation of [RFC5234] with a list extension, defined in Section 7 of
216   [RFC7230], that allows for compact definition of comma-separated
217   lists using a '#' operator (similar to how the '*' operator indicates
218   repetition).  Appendix B describes rules imported from other
219   documents.  Appendix C shows the collected grammar with all list
220
221
222
223Fielding & Reschke      Expires November 15, 2014               [Page 4]
224
225Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
226
227
228   operators expanded to standard ABNF notation.
229
2302.  Validators
231
232   This specification defines two forms of metadata that are commonly
233   used to observe resource state and test for preconditions:
234   modification dates (Section 2.2) and opaque entity tags
235   (Section 2.3).  Additional metadata that reflects resource state has
236   been defined by various extensions of HTTP, such as Web Distributed
237   Authoring and Versioning (WebDAV, [RFC4918]), that are beyond the
238   scope of this specification.  A resource metadata value is referred
239   to as a "validator" when it is used within a precondition.
240
2412.1.  Weak versus Strong
242
243   Validators come in two flavors: strong or weak.  Weak validators are
244   easy to generate but are far less useful for comparisons.  Strong
245   validators are ideal for comparisons but can be very difficult (and
246   occasionally impossible) to generate efficiently.  Rather than impose
247   that all forms of resource adhere to the same strength of validator,
248   HTTP exposes the type of validator in use and imposes restrictions on
249   when weak validators can be used as preconditions.
250
251   A "strong validator" is representation metadata that changes value
252   whenever a change occurs to the representation data that would be
253   observable in the payload body of a 200 (OK) response to GET.
254
255   A strong validator might change for reasons other than a change to
256   the representation data, such as when a semantically significant part
257   of the representation metadata is changed (e.g., Content-Type), but
258   it is in the best interests of the origin server to only change the
259   value when it is necessary to invalidate the stored responses held by
260   remote caches and authoring tools.
261
262   Cache entries might persist for arbitrarily long periods, regardless
263   of expiration times.  Thus, a cache might attempt to validate an
264   entry using a validator that it obtained in the distant past.  A
265   strong validator is unique across all versions of all representations
266   associated with a particular resource over time.  However, there is
267   no implication of uniqueness across representations of different
268   resources (i.e., the same strong validator might be in use for
269   representations of multiple resources at the same time and does not
270   imply that those representations are equivalent).
271
272   There are a variety of strong validators used in practice.  The best
273   are based on strict revision control, wherein each change to a
274   representation always results in a unique node name and revision
275   identifier being assigned before the representation is made
276
277
278
279Fielding & Reschke      Expires November 15, 2014               [Page 5]
280
281Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
282
283
284   accessible to GET.  A collision-resistant hash function applied to
285   the representation data is also sufficient if the data is available
286   prior to the response header fields being sent and the digest does
287   not need to be recalculated every time a validation request is
288   received.  However, if a resource has distinct representations that
289   differ only in their metadata, such as might occur with content
290   negotiation over media types that happen to share the same data
291   format, then the origin server needs to incorporate additional
292   information in the validator to distinguish those representations.
293
294   In contrast, a "weak validator" is representation metadata that might
295   not change for every change to the representation data.  This
296   weakness might be due to limitations in how the value is calculated,
297   such as clock resolution, an inability to ensure uniqueness for all
298   possible representations of the resource, or a desire of the resource
299   owner to group representations by some self-determined set of
300   equivalency rather than unique sequences of data.  An origin server
301   SHOULD change a weak entity-tag whenever it considers prior
302   representations to be unacceptable as a substitute for the current
303   representation.  In other words, a weak entity-tag ought to change
304   whenever the origin server wants caches to invalidate old responses.
305
306   For example, the representation of a weather report that changes in
307   content every second, based on dynamic measurements, might be grouped
308   into sets of equivalent representations (from the origin server's
309   perspective) with the same weak validator in order to allow cached
310   representations to be valid for a reasonable period of time (perhaps
311   adjusted dynamically based on server load or weather quality).
312   Likewise, a representation's modification time, if defined with only
313   one-second resolution, might be a weak validator if it is possible
314   for the representation to be modified twice during a single second
315   and retrieved between those modifications.
316
317   Likewise, a validator is weak if it is shared by two or more
318   representations of a given resource at the same time, unless those
319   representations have identical representation data.  For example, if
320   the origin server sends the same validator for a representation with
321   a gzip content coding applied as it does for a representation with no
322   content coding, then that validator is weak.  However, two
323   simultaneous representations might share the same strong validator if
324   they differ only in the representation metadata, such as when two
325   different media types are available for the same representation data.
326
327   Strong validators are usable for all conditional requests, including
328   cache validation, partial content ranges, and "lost update"
329   avoidance.  Weak validators are only usable when the client does not
330   require exact equality with previously obtained representation data,
331   such as when validating a cache entry or limiting a web traversal to
332
333
334
335Fielding & Reschke      Expires November 15, 2014               [Page 6]
336
337Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
338
339
340   recent changes.
341
3422.2.  Last-Modified
343
344   The "Last-Modified" header field in a response provides a timestamp
345   indicating the date and time at which the origin server believes the
346   selected representation was last modified, as determined at the
347   conclusion of handling the request.
348
349     Last-Modified = HTTP-date
350
351   An example of its use is
352
353     Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT
354
3552.2.1.  Generation
356
357   An origin server SHOULD send Last-Modified for any selected
358   representation for which a last modification date can be reasonably
359   and consistently determined, since its use in conditional requests
360   and evaluating cache freshness ([RFC7234]) results in a substantial
361   reduction of HTTP traffic on the Internet and can be a significant
362   factor in improving service scalability and reliability.
363
364   A representation is typically the sum of many parts behind the
365   resource interface.  The last-modified time would usually be the most
366   recent time that any of those parts were changed.  How that value is
367   determined for any given resource is an implementation detail beyond
368   the scope of this specification.  What matters to HTTP is how
369   recipients of the Last-Modified header field can use its value to
370   make conditional requests and test the validity of locally cached
371   responses.
372
373   An origin server SHOULD obtain the Last-Modified value of the
374   representation as close as possible to the time that it generates the
375   Date field value for its response.  This allows a recipient to make
376   an accurate assessment of the representation's modification time,
377   especially if the representation changes near the time that the
378   response is generated.
379
380   An origin server with a clock MUST NOT send a Last-Modified date that
381   is later than the server's time of message origination (Date).  If
382   the last modification time is derived from implementation-specific
383   metadata that evaluates to some time in the future, according to the
384   origin server's clock, then the origin server MUST replace that value
385   with the message origination date.  This prevents a future
386   modification date from having an adverse impact on cache validation.
387
388
389
390
391Fielding & Reschke      Expires November 15, 2014               [Page 7]
392
393Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
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 November 15, 2014               [Page 8]
448
449Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
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 November 15, 2014               [Page 9]
504
505Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
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 file attributes, or
523   a modification timestamp that has sub-second resolution.
524
525   An origin server SHOULD send an ETag for any selected representation
526   for which detection of changes can be reasonably and consistently
527   determined, since the entity-tag's use in conditional requests and
528   evaluating cache freshness ([RFC7234]) can result in a substantial
529   reduction of HTTP network traffic and can be a significant factor in
530   improving service scalability and reliability.
531
5322.3.2.  Comparison
533
534   There are two entity-tag comparison functions, depending on whether
535   or not the comparison context allows the use of weak validators:
536
537   o  Strong comparison: two entity-tags are equivalent if both are not
538      weak and their opaque-tags match character-by-character.
539
540   o  Weak comparison: two entity-tags are equivalent if their opaque-
541      tags match character-by-character, regardless of either or both
542      being tagged as "weak".
543
544   The example below shows the results for a set of entity-tag pairs and
545   both the weak and strong comparison function results:
546
547   +--------+--------+-------------------+-----------------+
548   | ETag 1 | ETag 2 | Strong Comparison | Weak Comparison |
549   +--------+--------+-------------------+-----------------+
550   | W/"1"  | W/"1"  | no match          | match           |
551   | W/"1"  | W/"2"  | no match          | no match        |
552   | W/"1"  | "1"    | no match          | match           |
553   | "1"    | "1"    | match             | match           |
554   +--------+--------+-------------------+-----------------+
555
556
557
558
559Fielding & Reschke      Expires November 15, 2014              [Page 10]
560
561Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
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 [RFC7231]), and where the representations sent in response to
568   a GET request vary based on the Accept-Encoding request header field
569   (Section 5.3.4 of [RFC7231]):
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 November 15, 2014              [Page 11]
616
617Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
618
619
620      Note: Content codings are a property of the representation data,
621      so a strong entity-tag for a content-encoded representation has to
622      be distinct from the entity tag of an unencoded representation to
623      prevent potential conflicts during cache updates and range
624      requests.  In contrast, transfer codings (Section 4 of [RFC7230])
625      apply only during message transfer and do not result in distinct
626      entity-tags.
627
6282.4.  When to Use Entity-Tags and Last-Modified Dates
629
630   In 200 (OK) responses to GET or HEAD, an origin server:
631
632   o  SHOULD send an entity-tag validator unless it is not feasible to
633      generate one.
634
635   o  MAY send a weak entity-tag instead of a strong entity-tag, if
636      performance considerations support the use of weak entity-tags, or
637      if it is unfeasible to send a strong entity-tag.
638
639   o  SHOULD send a Last-Modified value if it is feasible to send one.
640
641   In other words, the preferred behavior for an origin server is to
642   send both a strong entity-tag and a Last-Modified value in successful
643   responses to a retrieval request.
644
645   A client:
646
647   o  MUST send that entity-tag in any cache validation request (using
648      If-Match or If-None-Match) if an entity-tag has been provided by
649      the origin server.
650
651   o  SHOULD send the Last-Modified value in non-subrange cache
652      validation requests (using If-Modified-Since) if only a Last-
653      Modified value has been provided by the origin server.
654
655   o  MAY send the Last-Modified value in subrange cache validation
656      requests (using If-Unmodified-Since) if only a Last-Modified value
657      has been provided by an HTTP/1.0 origin server.  The user agent
658      SHOULD provide a way to disable this, in case of difficulty.
659
660   o  SHOULD send both validators in cache validation requests if both
661      an entity-tag and a Last-Modified value have been provided by the
662      origin server.  This allows both HTTP/1.0 and HTTP/1.1 caches to
663      respond appropriately.
664
665
666
667
668
669
670
671Fielding & Reschke      Expires November 15, 2014              [Page 12]
672
673Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
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
722   MUST 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 November 15, 2014              [Page 13]
728
729Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
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 November 15, 2014              [Page 14]
784
785Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
786
787
788   believes that the resource does not have a current representation
789   (Section 4.2.1 of [RFC7231]).  This is a variation on the "lost
790   update" problem that might arise if more than one client attempts to
791   create 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 code
805   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 [RFC7234].
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 November 15, 2014              [Page 15]
840
841Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
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 [RFC7234].
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 November 15, 2014              [Page 16]
896
897Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
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 November 15, 2014              [Page 17]
952
953Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
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 that instructs the recipient to ignore the Range
961   header field if the validator doesn't match, resulting in transfer of
962   the new selected representation instead of a 412 response.  If-Range
963   is defined in Section 3.2 of [RFC7233].
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
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 [RFC7234].  If the conditional request originated
993   with an outbound client, such as a user agent with its own cache
994   sending a conditional GET to a shared proxy, then the proxy SHOULD
995   forward the 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 November 15, 2014              [Page 18]
1008
1009Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
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 it 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 November 15, 2014              [Page 19]
1064
1065Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
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 November 15, 2014              [Page 20]
1120
1121Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
1122
1123
1124       *  if the validator matches and the Range specification is
1125          applicable to the selected representation, respond 206
1126          (Partial Content) [RFC7233]
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 "Hypertext Transfer Protocol (HTTP) Status Code Registry" located
1143   at <http://www.iana.org/assignments/http-status-codes> has been
1144   updated 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 Headers"
1156   registry maintained at
1157   <http://www.iana.org/assignments/message-headers/>.
1158
1159   This document defines the following HTTP header fields, so the
1160   "Permanent Message Header Field Names" registry has been updated
1161   accordingly (see [BCP90]).
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175Fielding & Reschke      Expires November 15, 2014              [Page 21]
1176
1177Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
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 conditional
1198   request mechanisms.  More general security considerations are
1199   addressed in HTTP messaging [RFC7230] and semantics [RFC7231].
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 [RFC7230].
1224
122510.  References
1226
1227
1228
1229
1230
1231Fielding & Reschke      Expires November 15, 2014              [Page 22]
1232
1233Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
1234
1235
123610.1.  Normative References
1237
1238   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
1239              Requirement Levels", BCP 14, RFC 2119, March 1997.
1240
1241   [RFC5234]  Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
1242              Specifications: ABNF", STD 68, RFC 5234, January 2008.
1243
1244   [RFC7230]  Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer
1245              Protocol (HTTP/1.1): Message Syntax and Routing",
1246              draft-ietf-httpbis-p1-messaging-latest (work in progress),
1247              May 2014.
1248
1249   [RFC7231]  Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer
1250              Protocol (HTTP/1.1): Semantics and Content",
1251              draft-ietf-httpbis-p2-semantics-latest (work in progress),
1252              May 2014.
1253
1254   [RFC7233]  Fielding, R., Ed., Lafon, Y., Ed., and J. Reschke, Ed.,
1255              "Hypertext Transfer Protocol (HTTP/1.1): Range Requests",
1256              draft-ietf-httpbis-p5-range-latest (work in progress),
1257              May 2014.
1258
1259   [RFC7234]  Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke,
1260              Ed., "Hypertext Transfer Protocol (HTTP/1.1): Caching",
1261              draft-ietf-httpbis-p6-cache-latest (work in progress),
1262              May 2014.
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 November 15, 2014              [Page 23]
1288
1289Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
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 [RFC7230]:
1312
1313     OWS           = <OWS, see [RFC7230], Section 3.2.3>
1314     obs-text      = <obs-text, see [RFC7230], Section 3.2.6>
1315
1316   The rules below are defined in other parts:
1317
1318     HTTP-date     = <HTTP-date, see [RFC7231], 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 [RFC7230].
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343Fielding & Reschke      Expires November 15, 2014              [Page 24]
1344
1345Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
1346
1347
1348   ETag = entity-tag
1349
1350   HTTP-date = <HTTP-date, see [RFC7231], 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, see [RFC7230], Section 3.2.3>
1362
1363   entity-tag = [ weak ] opaque-tag
1364   etagc = "!" / %x23-7E ; '#'-'~'
1365    / obs-text
1366
1367   obs-text = <obs-text, see [RFC7230], Section 3.2.6>
1368   opaque-tag = DQUOTE *etagc DQUOTE
1369
1370   weak = %x57.2F ; W/
1371
1372Index
1373
1374   3
1375      304 Not Modified (status code)  18
1376
1377   4
1378      412 Precondition Failed (status code)  18
1379
1380   E
1381      ETag header field  9
1382
1383   G
1384      Grammar
1385         entity-tag  9
1386         ETag  9
1387         etagc  9
1388         If-Match  13
1389         If-Modified-Since  15
1390         If-None-Match  14
1391         If-Unmodified-Since  16
1392         Last-Modified  7
1393         opaque-tag  9
1394         weak  9
1395
1396
1397
1398
1399Fielding & Reschke      Expires November 15, 2014              [Page 25]
1400
1401Internet-Draft        HTTP/1.1 Conditional Requests             May 2014
1402
1403
1404   I
1405      If-Match header field  13
1406      If-Modified-Since header field  15
1407      If-None-Match header field  14
1408      If-Unmodified-Since header field  16
1409
1410   L
1411      Last-Modified header field  7
1412
1413   M
1414      metadata  5
1415
1416   S
1417      selected representation  4
1418
1419   V
1420      validator  5
1421         strong  5
1422         weak  5
1423
1424Authors' Addresses
1425
1426   Roy T. Fielding (editor)
1427   Adobe Systems Incorporated
1428   345 Park Ave
1429   San Jose, CA  95110
1430   USA
1431
1432   EMail: fielding@gbiv.com
1433   URI:   http://roy.gbiv.com/
1434
1435
1436   Julian F. Reschke (editor)
1437   greenbytes GmbH
1438   Hafenweg 16
1439   Muenster, NW  48155
1440   Germany
1441
1442   EMail: julian.reschke@greenbytes.de
1443   URI:   http://greenbytes.de/tech/webdav/
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455Fielding & Reschke      Expires November 15, 2014              [Page 26]
1456
Note: See TracBrowser for help on using the repository browser.