1 | <?xml version="1.0" encoding="utf-8"?> |
---|
2 | <?xml-stylesheet type='text/xsl' href='../myxml2rfc.xslt'?> |
---|
3 | <!DOCTYPE rfc [ |
---|
4 | <!ENTITY MAY "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MAY</bcp14>"> |
---|
5 | <!ENTITY MUST "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST</bcp14>"> |
---|
6 | <!ENTITY MUST-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST NOT</bcp14>"> |
---|
7 | <!ENTITY OPTIONAL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>OPTIONAL</bcp14>"> |
---|
8 | <!ENTITY RECOMMENDED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>RECOMMENDED</bcp14>"> |
---|
9 | <!ENTITY REQUIRED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>REQUIRED</bcp14>"> |
---|
10 | <!ENTITY SHALL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL</bcp14>"> |
---|
11 | <!ENTITY SHALL-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL NOT</bcp14>"> |
---|
12 | <!ENTITY SHOULD "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD</bcp14>"> |
---|
13 | <!ENTITY SHOULD-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD NOT</bcp14>"> |
---|
14 | <!ENTITY ID-VERSION "19"> |
---|
15 | <!ENTITY ID-MONTH "March"> |
---|
16 | <!ENTITY ID-YEAR "2012"> |
---|
17 | <!ENTITY architecture "<xref target='Part1' x:rel='#architecture' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
18 | <!ENTITY notation "<xref target='Part1' x:rel='#notation' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
19 | <!ENTITY abnf-extension "<xref target='Part1' x:rel='#abnf.extension' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
20 | <!ENTITY acks "<xref target='Part1' x:rel='#acks' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
21 | <!ENTITY whitespace "<xref target='Part1' x:rel='#whitespace' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
22 | <!ENTITY field-components "<xref target='Part1' x:rel='#field.components' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
23 | <!ENTITY header-date "<xref target='Part2' x:rel='#header.date' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
24 | <!ENTITY messaging "<xref target='Part1' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
25 | <!ENTITY caching "<xref target='Part6' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
26 | <!ENTITY header-accept-encoding "<xref target='Part3' x:rel='#header.accept-encoding' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
27 | <!ENTITY header-if-range "<xref target='Part5' x:rel='#header.if-range' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
28 | <!ENTITY header-range "<xref target='Part5' x:rel='#header.range' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
29 | <!ENTITY header-vary "<xref target='Part6' x:rel='#header.vary' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
30 | <!ENTITY http-date "<xref target='Part2' x:rel='#http.date' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
31 | <!ENTITY transfer-codings "<xref target='Part1' x:rel='#transfer.codings' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
32 | <!ENTITY content-negotiation "<xref target='Part3' x:rel='#content.negotiation' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
33 | ]> |
---|
34 | <?rfc toc="yes" ?> |
---|
35 | <?rfc symrefs="yes" ?> |
---|
36 | <?rfc sortrefs="yes" ?> |
---|
37 | <?rfc compact="yes"?> |
---|
38 | <?rfc subcompact="no" ?> |
---|
39 | <?rfc linkmailto="no" ?> |
---|
40 | <?rfc editing="no" ?> |
---|
41 | <?rfc comments="yes"?> |
---|
42 | <?rfc inline="yes"?> |
---|
43 | <?rfc rfcedstyle="yes"?> |
---|
44 | <?rfc-ext allow-markup-in-artwork="yes" ?> |
---|
45 | <?rfc-ext include-references-in-index="yes" ?> |
---|
46 | <rfc obsoletes="2616" category="std" x:maturity-level="proposed" |
---|
47 | ipr="pre5378Trust200902" docName="draft-ietf-httpbis-p4-conditional-&ID-VERSION;" |
---|
48 | xmlns:x='http://purl.org/net/xml2rfc/ext'> |
---|
49 | <x:link rel="prev" basename="p3-payload"/> |
---|
50 | <x:link rel="next" basename="p5-range"/> |
---|
51 | <x:feedback template="mailto:ietf-http-wg@w3.org?subject={docname},%20%22{section}%22&body=<{ref}>:"/> |
---|
52 | <front> |
---|
53 | |
---|
54 | <title abbrev="HTTP/1.1, Part 4">HTTP/1.1, part 4: Conditional Requests</title> |
---|
55 | |
---|
56 | <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor"> |
---|
57 | <organization abbrev="Adobe">Adobe Systems Incorporated</organization> |
---|
58 | <address> |
---|
59 | <postal> |
---|
60 | <street>345 Park Ave</street> |
---|
61 | <city>San Jose</city> |
---|
62 | <region>CA</region> |
---|
63 | <code>95110</code> |
---|
64 | <country>USA</country> |
---|
65 | </postal> |
---|
66 | <email>fielding@gbiv.com</email> |
---|
67 | <uri>http://roy.gbiv.com/</uri> |
---|
68 | </address> |
---|
69 | </author> |
---|
70 | |
---|
71 | <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor"> |
---|
72 | <organization abbrev="W3C">World Wide Web Consortium</organization> |
---|
73 | <address> |
---|
74 | <postal> |
---|
75 | <street>W3C / ERCIM</street> |
---|
76 | <street>2004, rte des Lucioles</street> |
---|
77 | <city>Sophia-Antipolis</city> |
---|
78 | <region>AM</region> |
---|
79 | <code>06902</code> |
---|
80 | <country>France</country> |
---|
81 | </postal> |
---|
82 | <email>ylafon@w3.org</email> |
---|
83 | <uri>http://www.raubacapeu.net/people/yves/</uri> |
---|
84 | </address> |
---|
85 | </author> |
---|
86 | |
---|
87 | <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor"> |
---|
88 | <organization abbrev="greenbytes">greenbytes GmbH</organization> |
---|
89 | <address> |
---|
90 | <postal> |
---|
91 | <street>Hafenweg 16</street> |
---|
92 | <city>Muenster</city><region>NW</region><code>48155</code> |
---|
93 | <country>Germany</country> |
---|
94 | </postal> |
---|
95 | <phone>+49 251 2807760</phone> |
---|
96 | <facsimile>+49 251 2807761</facsimile> |
---|
97 | <email>julian.reschke@greenbytes.de</email> |
---|
98 | <uri>http://greenbytes.de/tech/webdav/</uri> |
---|
99 | </address> |
---|
100 | </author> |
---|
101 | |
---|
102 | <date month="&ID-MONTH;" year="&ID-YEAR;" day="12"/> |
---|
103 | <workgroup>HTTPbis Working Group</workgroup> |
---|
104 | |
---|
105 | <abstract> |
---|
106 | <t> |
---|
107 | The Hypertext Transfer Protocol (HTTP) is an application-level protocol for |
---|
108 | distributed, collaborative, hypertext information systems. HTTP has been in |
---|
109 | use by the World Wide Web global information initiative since 1990. This |
---|
110 | document is Part 4 of the seven-part specification that defines the protocol |
---|
111 | referred to as "HTTP/1.1" and, taken together, obsoletes RFC 2616. |
---|
112 | </t> |
---|
113 | <t> |
---|
114 | Part 4 defines request header fields for indicating conditional requests and |
---|
115 | the rules for constructing responses to those requests. |
---|
116 | </t> |
---|
117 | </abstract> |
---|
118 | |
---|
119 | <note title="Editorial Note (To be removed by RFC Editor)"> |
---|
120 | <t> |
---|
121 | Discussion of this draft should take place on the HTTPBIS working group |
---|
122 | mailing list (ietf-http-wg@w3.org), which is archived at |
---|
123 | <eref target="http://lists.w3.org/Archives/Public/ietf-http-wg/"/>. |
---|
124 | </t> |
---|
125 | <t> |
---|
126 | The current issues list is at |
---|
127 | <eref target="http://tools.ietf.org/wg/httpbis/trac/report/3"/> and related |
---|
128 | documents (including fancy diffs) can be found at |
---|
129 | <eref target="http://tools.ietf.org/wg/httpbis/"/>. |
---|
130 | </t> |
---|
131 | <t> |
---|
132 | The changes in this draft are summarized in <xref target="changes.since.18"/>. |
---|
133 | </t> |
---|
134 | </note> |
---|
135 | </front> |
---|
136 | <middle> |
---|
137 | <section title="Introduction" anchor="introduction"> |
---|
138 | <t> |
---|
139 | This document defines the HTTP/1.1 conditional request mechanisms, |
---|
140 | including both metadata for indicating/observing changes in resource |
---|
141 | representations and request header fields that specify preconditions |
---|
142 | on that metadata be checked before performing the request method. |
---|
143 | Conditional GET requests are the most efficient mechanism for HTTP |
---|
144 | cache updates &caching;. Conditionals can also be |
---|
145 | applied to state-changing methods, such as PUT and DELETE, to prevent |
---|
146 | the "lost update" problem: one client accidentally overwriting |
---|
147 | the work of another client that has been acting in parallel. |
---|
148 | </t> |
---|
149 | <t> |
---|
150 | Conditional request preconditions are based on the state of the target |
---|
151 | resource as a whole (its current value set) or the state as observed |
---|
152 | in a previously obtained representation (one value in that set). |
---|
153 | A resource might have multiple current representations, each with its |
---|
154 | own observable state. The conditional request mechanisms assume that |
---|
155 | the mapping of requests to corresponding representations will be |
---|
156 | consistent over time if the server intends to take advantage of |
---|
157 | conditionals. Regardless, if the mapping is inconsistent and |
---|
158 | the server is unable to select the appropriate representation, then |
---|
159 | no harm will result when the precondition evaluates to false. |
---|
160 | </t> |
---|
161 | <t><iref primary="true" item="selected representation"/> |
---|
162 | We use the term "<x:dfn>selected representation</x:dfn>" to refer to |
---|
163 | the current representation of the target resource that would have been |
---|
164 | selected in a successful response if the same request had used the method |
---|
165 | GET and had excluded all of the conditional request header fields. |
---|
166 | The conditional request preconditions are evaluated by comparing the |
---|
167 | values provided in the request header fields to the current metadata |
---|
168 | for the selected representation. |
---|
169 | </t> |
---|
170 | |
---|
171 | <section title="Conformance and Error Handling" anchor="intro.conformance.and.error.handling"> |
---|
172 | <t> |
---|
173 | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", |
---|
174 | "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this |
---|
175 | document are to be interpreted as described in <xref target="RFC2119"/>. |
---|
176 | </t> |
---|
177 | <t> |
---|
178 | This document defines conformance criteria for several roles in HTTP |
---|
179 | communication, including Senders, Recipients, Clients, Servers, User-Agents, |
---|
180 | Origin Servers, Intermediaries, Proxies and Gateways. See &architecture; |
---|
181 | for definitions of these terms. |
---|
182 | </t> |
---|
183 | <t> |
---|
184 | An implementation is considered conformant if it complies with all of the |
---|
185 | requirements associated with its role(s). Note that SHOULD-level requirements |
---|
186 | are relevant here, unless one of the documented exceptions is applicable. |
---|
187 | </t> |
---|
188 | <t> |
---|
189 | This document also uses ABNF to define valid protocol elements |
---|
190 | (<xref target="notation"/>). In addition to the prose requirements placed |
---|
191 | upon them, Senders &MUST-NOT; generate protocol elements that are invalid. |
---|
192 | </t> |
---|
193 | <t> |
---|
194 | Unless noted otherwise, Recipients &MAY; take steps to recover a usable |
---|
195 | protocol element from an invalid construct. However, HTTP does not define |
---|
196 | specific error handling mechanisms, except in cases where it has direct |
---|
197 | impact on security. This is because different uses of the protocol require |
---|
198 | different error handling strategies; for example, a Web browser may wish to |
---|
199 | transparently recover from a response where the Location header field |
---|
200 | doesn't parse according to the ABNF, whereby in a systems control protocol |
---|
201 | using HTTP, this type of error recovery could lead to dangerous consequences. |
---|
202 | </t> |
---|
203 | </section> |
---|
204 | |
---|
205 | <section title="Syntax Notation" anchor="notation"> |
---|
206 | <x:anchor-alias value="ALPHA"/> |
---|
207 | <x:anchor-alias value="CR"/> |
---|
208 | <x:anchor-alias value="DIGIT"/> |
---|
209 | <x:anchor-alias value="DQUOTE"/> |
---|
210 | <x:anchor-alias value="LF"/> |
---|
211 | <x:anchor-alias value="OCTET"/> |
---|
212 | <x:anchor-alias value="VCHAR"/> |
---|
213 | <x:anchor-alias value="core.rules"/> |
---|
214 | <x:anchor-alias value="obs-text"/> |
---|
215 | <x:anchor-alias value="OWS"/> |
---|
216 | <x:anchor-alias value="HTTP-date"/> |
---|
217 | <t> |
---|
218 | This specification uses the Augmented Backus-Naur Form (ABNF) notation |
---|
219 | of <xref target="RFC5234"/> with the list rule extension defined in |
---|
220 | ¬ation;. <xref target="collected.abnf"/> shows the collected ABNF |
---|
221 | with the list rule expanded. |
---|
222 | </t> |
---|
223 | <t> |
---|
224 | The following core rules are included by |
---|
225 | reference, as defined in <xref target="RFC5234" x:fmt="," x:sec="B.1"/>: |
---|
226 | ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls), |
---|
227 | DIGIT (decimal 0-9), DQUOTE (double quote), |
---|
228 | HEXDIG (hexadecimal 0-9/A-F/a-f), LF (line feed), |
---|
229 | OCTET (any 8-bit sequence of data), SP (space), and |
---|
230 | VCHAR (any visible US-ASCII character). |
---|
231 | </t> |
---|
232 | <t> |
---|
233 | The ABNF rules below are defined in <xref target="Part1"/> and |
---|
234 | <xref target="Part2"/>: |
---|
235 | </t> |
---|
236 | <figure><artwork type="abnf2616"> |
---|
237 | <x:ref>OWS</x:ref> = <OWS, defined in &whitespace;> |
---|
238 | <x:ref>obs-text</x:ref> = <obs-text, defined in &field-components;> |
---|
239 | <x:ref>HTTP-date</x:ref> = <HTTP-date, defined in &http-date;> |
---|
240 | </artwork></figure> |
---|
241 | </section> |
---|
242 | </section> |
---|
243 | |
---|
244 | <section title="Validators" anchor="validators"> |
---|
245 | <iref primary="true" item="metadata"/> |
---|
246 | <iref primary="true" item="validator"/> |
---|
247 | <t> |
---|
248 | This specification defines two forms of metadata that are commonly used |
---|
249 | to observe resource state and test for preconditions: modification dates |
---|
250 | and opaque entity tags. Additional metadata that reflects resource state |
---|
251 | has been defined by various extensions of HTTP, such as WebDAV |
---|
252 | <xref target="RFC4918"/>, that are beyond the scope of this specification. |
---|
253 | A resource metadata value is referred to as a "<x:dfn>validator</x:dfn>" |
---|
254 | when it is used within a precondition. |
---|
255 | </t> |
---|
256 | |
---|
257 | <section title="Weak versus Strong" anchor="weak.and.strong.validators"> |
---|
258 | <iref primary="true" item="validator" subitem="weak"/> |
---|
259 | <iref primary="true" item="validator" subitem="strong"/> |
---|
260 | <t> |
---|
261 | Validators come in two flavors: strong or weak. Weak validators are easy |
---|
262 | to generate but are far less useful for comparisons. Strong validators |
---|
263 | are ideal for comparisons but can be very difficult (and occasionally |
---|
264 | impossible) to generate efficiently. Rather than impose that all forms |
---|
265 | of resource adhere to the same strength of validator, HTTP exposes the |
---|
266 | type of validator in use and imposes restrictions on when weak validators |
---|
267 | can be used as preconditions. |
---|
268 | </t> |
---|
269 | <t> |
---|
270 | A "strong validator" is a representation metadata value that &MUST; be |
---|
271 | changed to a new, previously unused or guaranteed unique, value whenever |
---|
272 | a change occurs to the representation data such that a change would be |
---|
273 | observable in the payload body of a 200 response to GET. A strong |
---|
274 | validator &MAY; be changed for other reasons, such as when a semantically |
---|
275 | significant part of the representation metadata is changed (e.g., |
---|
276 | Content-Type), but it is in the best interests of the origin server to only |
---|
277 | change the value when it is necessary to invalidate the stored responses |
---|
278 | held by remote caches and authoring tools. A strong validator &MUST; be |
---|
279 | unique across all representations of a given resource, such that no two |
---|
280 | representations of that resource share the same validator unless |
---|
281 | their payload body would be identical. |
---|
282 | </t> |
---|
283 | <t> |
---|
284 | Cache entries might persist for arbitrarily long periods, regardless |
---|
285 | of expiration times. Thus, a cache might attempt to validate an |
---|
286 | entry using a validator that it obtained in the distant past. |
---|
287 | A strong validator &MUST; be unique across all versions of all |
---|
288 | representations associated with a particular resource over time. |
---|
289 | However, there is no implication of uniqueness across representations |
---|
290 | of different resources (i.e., the same strong validator might be |
---|
291 | in use for representations of multiple resources at the same time |
---|
292 | and does not imply that those representations are equivalent). |
---|
293 | </t> |
---|
294 | <t> |
---|
295 | There are a variety of strong validators used in practice. The best are |
---|
296 | based on strict revision control, wherein each change to a representation |
---|
297 | always results in a unique node name and revision identifier being assigned |
---|
298 | before the representation is made accessible to GET. A cryptographic hash |
---|
299 | function applied to the representation data is also sufficient if the data |
---|
300 | is available prior to the response header fields being sent and the digest |
---|
301 | does not need to be recalculated every time a validation request is |
---|
302 | received. However, if a resource has distinct representations that differ |
---|
303 | only in their metadata, such as might occur with content negotiation over |
---|
304 | media types that happen to share the same data format, then a server |
---|
305 | &SHOULD; incorporate additional information in the validator to |
---|
306 | distinguish those representations and avoid confusing cache behavior. |
---|
307 | </t> |
---|
308 | <t> |
---|
309 | In contrast, a "weak validator" is a representation metadata value that |
---|
310 | might not be changed for every change to the representation data. This |
---|
311 | weakness might be due to limitations in how the value is calculated, such |
---|
312 | as clock resolution or an inability to ensure uniqueness for all possible |
---|
313 | representations of the resource, or due to a desire by the resource owner |
---|
314 | to group representations by some self-determined set of equivalency |
---|
315 | rather than unique sequences of data. A weak entity-tag &SHOULD; change |
---|
316 | whenever the origin server considers prior representations to be |
---|
317 | unacceptable as a substitute for the current representation. In other |
---|
318 | words, a weak entity-tag &SHOULD; change whenever the origin server wants |
---|
319 | caches to invalidate old responses. |
---|
320 | </t> |
---|
321 | <t> |
---|
322 | For example, the representation of a weather report that changes in |
---|
323 | content every second, based on dynamic measurements, might be grouped |
---|
324 | into sets of equivalent representations (from the origin server's |
---|
325 | perspective) with the same weak validator in order to allow cached |
---|
326 | representations to be valid for a reasonable period of time (perhaps |
---|
327 | adjusted dynamically based on server load or weather quality). |
---|
328 | Likewise, a representation's modification time, if defined with only |
---|
329 | one-second resolution, might be a weak validator if it is possible |
---|
330 | for the representation to be modified twice during a single second and |
---|
331 | retrieved between those modifications. |
---|
332 | </t> |
---|
333 | <t> |
---|
334 | A "use" of a validator occurs when either a client generates a request |
---|
335 | and includes the validator in a precondition or when a server |
---|
336 | compares two validators. |
---|
337 | Weak validators are only usable in contexts that do not depend on exact |
---|
338 | equality of a representation's payload body. |
---|
339 | Strong validators are usable and preferred for all conditional requests, |
---|
340 | including cache validation, partial content ranges, and "lost update" |
---|
341 | avoidance. |
---|
342 | </t> |
---|
343 | </section> |
---|
344 | |
---|
345 | <section title="Last-Modified" anchor="header.last-modified"> |
---|
346 | <iref primary="true" item="Last-Modified header field" x:for-anchor=""/> |
---|
347 | <iref primary="true" item="Header Fields" subitem="Last-Modified" x:for-anchor=""/> |
---|
348 | <x:anchor-alias value="Last-Modified"/> |
---|
349 | <t> |
---|
350 | The "Last-Modified" header field indicates the date and time at |
---|
351 | which the origin server believes the selected representation was |
---|
352 | last modified. |
---|
353 | </t> |
---|
354 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Last-Modified"/> |
---|
355 | <x:ref>Last-Modified</x:ref> = <x:ref>HTTP-date</x:ref> |
---|
356 | </artwork></figure> |
---|
357 | <t> |
---|
358 | An example of its use is |
---|
359 | </t> |
---|
360 | <figure><artwork type="example"> |
---|
361 | Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT |
---|
362 | </artwork></figure> |
---|
363 | |
---|
364 | <section title="Generation" anchor="lastmod.generation"> |
---|
365 | <t> |
---|
366 | Origin servers &SHOULD; send Last-Modified for any selected |
---|
367 | representation for which a last modification date can be reasonably |
---|
368 | and consistently determined, since its use in conditional requests |
---|
369 | and evaluating cache freshness (&caching;) results in a substantial |
---|
370 | reduction of HTTP traffic on the Internet and can be a significant |
---|
371 | factor in improving service scalability and reliability. |
---|
372 | </t> |
---|
373 | <t> |
---|
374 | A representation is typically the sum of many parts behind the |
---|
375 | resource interface. The last-modified time would usually be |
---|
376 | the most recent time that any of those parts were changed. |
---|
377 | How that value is determined for any given resource is an |
---|
378 | implementation detail beyond the scope of this specification. |
---|
379 | What matters to HTTP is how recipients of the Last-Modified |
---|
380 | header field can use its value to make conditional requests |
---|
381 | and test the validity of locally cached responses. |
---|
382 | </t> |
---|
383 | <t> |
---|
384 | An origin server &SHOULD; obtain the Last-Modified value of the |
---|
385 | representation as close as possible to the time that it generates |
---|
386 | the Date field-value for its response. This allows a recipient to |
---|
387 | make an accurate assessment of the representation's modification time, |
---|
388 | especially if the representation changes near the time that the |
---|
389 | response is generated. |
---|
390 | </t> |
---|
391 | <t> |
---|
392 | An origin server with a clock &MUST-NOT; send a Last-Modified date |
---|
393 | that is later than the server's time of message origination (Date). |
---|
394 | If the last modification time is derived from implementation-specific |
---|
395 | metadata that evaluates to some time in the future, according to the |
---|
396 | origin server's clock, then the origin server &MUST; replace that |
---|
397 | value with the message origination date. This prevents a future |
---|
398 | modification date from having an adverse impact on cache validation. |
---|
399 | </t> |
---|
400 | <t> |
---|
401 | An origin server without a clock &MUST-NOT; assign Last-Modified |
---|
402 | values to a response unless these values were associated |
---|
403 | with the resource by some other system or user with a reliable clock. |
---|
404 | </t> |
---|
405 | </section> |
---|
406 | |
---|
407 | <section title="Comparison" anchor="lastmod.comparison"> |
---|
408 | <t> |
---|
409 | A Last-Modified time, when used as a validator in a request, is |
---|
410 | implicitly weak unless it is possible to deduce that it is strong, |
---|
411 | using the following rules: |
---|
412 | <list style="symbols"> |
---|
413 | <t>The validator is being compared by an origin server to the |
---|
414 | actual current validator for the representation and,</t> |
---|
415 | <t>That origin server reliably knows that the associated representation did |
---|
416 | not change twice during the second covered by the presented |
---|
417 | validator.</t> |
---|
418 | </list> |
---|
419 | </t> |
---|
420 | <t> |
---|
421 | or |
---|
422 | <list style="symbols"> |
---|
423 | <t>The validator is about to be used by a client in an If-Modified-Since, |
---|
424 | If-Unmodified-Since header field, because the client has a cache entry, |
---|
425 | or If-Range for the associated representation, and</t> |
---|
426 | <t>That cache entry includes a Date value, which gives the time |
---|
427 | when the origin server sent the original response, and</t> |
---|
428 | <t>The presented Last-Modified time is at least 60 seconds before |
---|
429 | the Date value.</t> |
---|
430 | </list> |
---|
431 | </t> |
---|
432 | <t> |
---|
433 | or |
---|
434 | <list style="symbols"> |
---|
435 | <t>The validator is being compared by an intermediate cache to the |
---|
436 | validator stored in its cache entry for the representation, and</t> |
---|
437 | <t>That cache entry includes a Date value, which gives the time |
---|
438 | when the origin server sent the original response, and</t> |
---|
439 | <t>The presented Last-Modified time is at least 60 seconds before |
---|
440 | the Date value.</t> |
---|
441 | </list> |
---|
442 | </t> |
---|
443 | <t> |
---|
444 | This method relies on the fact that if two different responses were |
---|
445 | sent by the origin server during the same second, but both had the |
---|
446 | same Last-Modified time, then at least one of those responses would |
---|
447 | have a Date value equal to its Last-Modified time. The arbitrary 60-second |
---|
448 | limit guards against the possibility that the Date and Last-Modified |
---|
449 | values are generated from different clocks, or at somewhat |
---|
450 | different times during the preparation of the response. An |
---|
451 | implementation &MAY; use a value larger than 60 seconds, if it is |
---|
452 | believed that 60 seconds is too short. |
---|
453 | </t> |
---|
454 | </section> |
---|
455 | </section> |
---|
456 | |
---|
457 | <section title="ETag" anchor="header.etag"> |
---|
458 | <iref primary="true" item="ETag header field" x:for-anchor=""/> |
---|
459 | <iref primary="true" item="Header Fields" subitem="ETag" x:for-anchor=""/> |
---|
460 | <x:anchor-alias value="ETag"/> |
---|
461 | <x:anchor-alias value="entity-tag"/> |
---|
462 | <x:anchor-alias value="entity.tags"/> |
---|
463 | <x:anchor-alias value="opaque-tag"/> |
---|
464 | <x:anchor-alias value="weak"/> |
---|
465 | <x:anchor-alias value="etagc"/> |
---|
466 | <t> |
---|
467 | The ETag header field provides the current entity-tag for the |
---|
468 | selected representation. |
---|
469 | An entity-tag is an opaque validator for differentiating between |
---|
470 | multiple representations of the same resource, regardless of whether |
---|
471 | those multiple representations are due to resource state changes over |
---|
472 | time, content negotiation resulting in multiple representations being |
---|
473 | valid at the same time, or both. An entity-tag consists of an opaque |
---|
474 | quoted string, possibly prefixed by a weakness indicator. |
---|
475 | </t> |
---|
476 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="ETag"/><iref primary="true" item="Grammar" subitem="entity-tag"/><iref primary="true" item="Grammar" subitem="weak"/><iref primary="true" item="Grammar" subitem="opaque-tag"/><iref primary="true" item="Grammar" subitem="etagc"/> |
---|
477 | <x:ref>ETag</x:ref> = <x:ref>entity-tag</x:ref> |
---|
478 | |
---|
479 | <x:ref>entity-tag</x:ref> = [ <x:ref>weak</x:ref> ] <x:ref>opaque-tag</x:ref> |
---|
480 | <x:ref>weak</x:ref> = <x:abnf-char-sequence>"W/"</x:abnf-char-sequence> ; "W/", case-sensitive |
---|
481 | <x:ref>opaque-tag</x:ref> = <x:ref>DQUOTE</x:ref> *<x:ref>etagc</x:ref> <x:ref>DQUOTE</x:ref> |
---|
482 | <x:ref>etagc</x:ref> = %x21 / %x23-7E / <x:ref>obs-text</x:ref> |
---|
483 | ; <x:ref>VCHAR</x:ref> except double quotes, plus obs-text |
---|
484 | </artwork></figure> |
---|
485 | <x:note> |
---|
486 | <t> |
---|
487 | <x:h>Note:</x:h> Previously, opaque-tag was defined to be a quoted-string |
---|
488 | (<xref target="RFC2616" x:fmt="," x:sec="3.11"/>), thus some recipients |
---|
489 | might perform backslash unescaping. Servers therefore ought to avoid |
---|
490 | backslash characters in entity tags. |
---|
491 | </t> |
---|
492 | </x:note> |
---|
493 | <t> |
---|
494 | An entity-tag can be more reliable for validation than a modification |
---|
495 | date in situations where it is inconvenient to store modification |
---|
496 | dates, where the one-second resolution of HTTP date values is not |
---|
497 | sufficient, or where modification dates are not consistently maintained. |
---|
498 | </t> |
---|
499 | <figure><preamble> |
---|
500 | Examples: |
---|
501 | </preamble> |
---|
502 | <artwork type="example"> |
---|
503 | ETag: "xyzzy" |
---|
504 | ETag: W/"xyzzy" |
---|
505 | ETag: "" |
---|
506 | </artwork></figure> |
---|
507 | <t> |
---|
508 | An entity-tag can be either a weak or strong validator, with |
---|
509 | strong being the default. If an origin server provides an entity-tag |
---|
510 | for a representation and the generation of that entity-tag does not satisfy |
---|
511 | the requirements for a strong validator |
---|
512 | (<xref target="weak.and.strong.validators"/>), then that |
---|
513 | entity-tag &MUST; be marked as weak by prefixing its opaque value |
---|
514 | with "W/" (case-sensitive). |
---|
515 | </t> |
---|
516 | |
---|
517 | <section title="Generation" anchor="entity.tag.generation"> |
---|
518 | <t> |
---|
519 | The principle behind entity-tags is that only the service author |
---|
520 | knows the implementation of a resource well enough to select the |
---|
521 | most accurate and efficient validation mechanism for that resource, |
---|
522 | and that any such mechanism can be mapped to a simple sequence of |
---|
523 | octets for easy comparison. Since the value is opaque, there is no |
---|
524 | need for the client to be aware of how each entity-tag is constructed. |
---|
525 | </t> |
---|
526 | <t> |
---|
527 | For example, a resource that has implementation-specific versioning |
---|
528 | applied to all changes might use an internal revision number, perhaps |
---|
529 | combined with a variance identifier for content negotiation, to |
---|
530 | accurately differentiate between representations. |
---|
531 | Other implementations might use a stored hash of representation content, |
---|
532 | a combination of various filesystem attributes, or a modification |
---|
533 | timestamp that has sub-second resolution. |
---|
534 | </t> |
---|
535 | <t> |
---|
536 | Origin servers &SHOULD; send ETag for any selected representation |
---|
537 | for which detection of changes can be reasonably and consistently |
---|
538 | determined, since the entity-tag's use in conditional requests and |
---|
539 | evaluating cache freshness (&caching;) can result in a substantial |
---|
540 | reduction of HTTP network traffic and can be a significant factor in |
---|
541 | improving service scalability and reliability. |
---|
542 | </t> |
---|
543 | </section> |
---|
544 | |
---|
545 | <section title="Comparison" anchor="entity.tag.comparison"> |
---|
546 | <x:anchor-alias value="validator.comparison"/> |
---|
547 | <t> |
---|
548 | There are two entity-tag comparison functions, depending |
---|
549 | on whether the comparison context allows the use of weak validators |
---|
550 | or not: |
---|
551 | <list style="symbols"> |
---|
552 | <t>The strong comparison function: in order to be considered equal, |
---|
553 | both opaque-tags &MUST; be identical character-by-character, and both |
---|
554 | &MUST-NOT; be weak.</t> |
---|
555 | <t>The weak comparison function: in order to be considered equal, both |
---|
556 | opaque-tags &MUST; be identical character-by-character, but |
---|
557 | either or both of them &MAY; be tagged as "weak" without affecting |
---|
558 | the result.</t> |
---|
559 | </list> |
---|
560 | </t> |
---|
561 | <t> |
---|
562 | The example below shows the results for a set of entity-tag pairs, |
---|
563 | and both the weak and strong comparison function results: |
---|
564 | </t> |
---|
565 | <texttable align="left"> |
---|
566 | <ttcol>ETag 1</ttcol> |
---|
567 | <ttcol>ETag 2</ttcol> |
---|
568 | <ttcol>Strong Comparison</ttcol> |
---|
569 | <ttcol>Weak Comparison</ttcol> |
---|
570 | |
---|
571 | <c>W/"1"</c> |
---|
572 | <c>W/"1"</c> |
---|
573 | <c>no match</c> |
---|
574 | <c>match</c> |
---|
575 | |
---|
576 | <c>W/"1"</c> |
---|
577 | <c>W/"2"</c> |
---|
578 | <c>no match</c> |
---|
579 | <c>no match</c> |
---|
580 | |
---|
581 | <c>W/"1"</c> |
---|
582 | <c>"1"</c> |
---|
583 | <c>no match</c> |
---|
584 | <c>match</c> |
---|
585 | |
---|
586 | <c>"1"</c> |
---|
587 | <c>"1"</c> |
---|
588 | <c>match</c> |
---|
589 | <c>match</c> |
---|
590 | </texttable> |
---|
591 | </section> |
---|
592 | |
---|
593 | <section title="Example: Entity-tags varying on Content-Negotiated Resources" anchor="example.entity.tag.vs.conneg"> |
---|
594 | <t> |
---|
595 | Consider a resource that is subject to content negotiation (&content-negotiation;), |
---|
596 | and where the representations returned upon a GET request vary based on |
---|
597 | the Accept-Encoding request header field (&header-accept-encoding;): |
---|
598 | </t> |
---|
599 | <figure><preamble>>> Request:</preamble><artwork type="message/http; msgtype="request"" x:indent-with=" "> |
---|
600 | GET /index HTTP/1.1 |
---|
601 | Host: www.example.com |
---|
602 | Accept-Encoding: gzip |
---|
603 | |
---|
604 | </artwork></figure> |
---|
605 | <t> |
---|
606 | In this case, the response might or might not use the gzip content coding. |
---|
607 | If it does not, the response might look like: |
---|
608 | </t> |
---|
609 | <figure><preamble>>> Response:</preamble><artwork type="message/http; msgtype="response"" x:indent-with=" "> |
---|
610 | HTTP/1.1 200 OK |
---|
611 | Date: Thu, 26 Mar 2010 00:05:00 GMT |
---|
612 | ETag: "123-a" |
---|
613 | Content-Length: <x:length-of target="exbody"/> |
---|
614 | Vary: Accept-Encoding |
---|
615 | Content-Type: text/plain |
---|
616 | |
---|
617 | <x:span anchor="exbody">Hello World! |
---|
618 | Hello World! |
---|
619 | Hello World! |
---|
620 | Hello World! |
---|
621 | Hello World! |
---|
622 | </x:span></artwork></figure> |
---|
623 | <t> |
---|
624 | An alternative representation that does use gzip content coding would be: |
---|
625 | </t> |
---|
626 | <figure><preamble>>> Response:</preamble><artwork type="message/http; msgtype="response"" x:indent-with=" "> |
---|
627 | HTTP/1.1 200 OK |
---|
628 | Date: Thu, 26 Mar 2010 00:05:00 GMT |
---|
629 | ETag: "123-b" |
---|
630 | Content-Length: 43 |
---|
631 | Vary: Accept-Encoding |
---|
632 | Content-Type: text/plain |
---|
633 | Content-Encoding: gzip |
---|
634 | |
---|
635 | <spanx>...binary data...</spanx></artwork></figure> |
---|
636 | <x:note> |
---|
637 | <t> |
---|
638 | <x:h>Note:</x:h> Content codings are a property of the representation, |
---|
639 | so therefore an entity-tag of an encoded representation must be distinct |
---|
640 | from an unencoded representation to prevent conflicts during cache updates |
---|
641 | and range requests. In contrast, transfer codings (&transfer-codings;) |
---|
642 | apply only during message transfer and do not require distinct entity-tags. |
---|
643 | </t> |
---|
644 | </x:note> |
---|
645 | </section> |
---|
646 | </section> |
---|
647 | |
---|
648 | <section title="Rules for When to Use Entity-tags and Last-Modified Dates" anchor="rules.for.when.to.use.entity.tags.and.last-modified.dates"> |
---|
649 | <t> |
---|
650 | We adopt a set of rules and recommendations for origin servers, |
---|
651 | clients, and caches regarding when various validator types ought to |
---|
652 | be used, and for what purposes. |
---|
653 | </t> |
---|
654 | <t> |
---|
655 | HTTP/1.1 origin servers: |
---|
656 | <list style="symbols"> |
---|
657 | <t>&SHOULD; send an entity-tag validator unless it is not feasible to |
---|
658 | generate one.</t> |
---|
659 | |
---|
660 | <t>&MAY; send a weak entity-tag instead of a strong entity-tag, if |
---|
661 | performance considerations support the use of weak entity-tags, |
---|
662 | or if it is unfeasible to send a strong entity-tag.</t> |
---|
663 | |
---|
664 | <t>&SHOULD; send a Last-Modified value if it is feasible to send one.</t> |
---|
665 | </list> |
---|
666 | </t> |
---|
667 | <t> |
---|
668 | In other words, the preferred behavior for an HTTP/1.1 origin server |
---|
669 | is to send both a strong entity-tag and a Last-Modified value. |
---|
670 | </t> |
---|
671 | <t> |
---|
672 | HTTP/1.1 clients: |
---|
673 | <list style="symbols"> |
---|
674 | <t>&MUST; use that entity-tag in any cache-conditional request (using |
---|
675 | If-Match or If-None-Match) if an entity-tag has been provided by the |
---|
676 | origin server.</t> |
---|
677 | |
---|
678 | <t>&SHOULD; use the Last-Modified value in non-subrange cache-conditional |
---|
679 | requests (using If-Modified-Since) if only a Last-Modified value has |
---|
680 | been provided by the origin server. </t> |
---|
681 | |
---|
682 | <t>&MAY; use the Last-Modified value in subrange cache-conditional |
---|
683 | requests (using If-Unmodified-Since) if only a Last-Modified value has |
---|
684 | been provided by an HTTP/1.0 origin server. The user agent &SHOULD; |
---|
685 | provide a way to disable this, in case of difficulty.</t> |
---|
686 | |
---|
687 | <t>&SHOULD; use both validators in cache-conditional requests if both an |
---|
688 | entity-tag and a Last-Modified value have been provided by the origin |
---|
689 | server. This allows both HTTP/1.0 and HTTP/1.1 caches to respond |
---|
690 | appropriately.</t> |
---|
691 | </list> |
---|
692 | </t> |
---|
693 | <t> |
---|
694 | An HTTP/1.1 origin server, upon receiving a conditional request that |
---|
695 | includes both a Last-Modified date (e.g., in an If-Modified-Since or |
---|
696 | If-Unmodified-Since header field) and one or more entity-tags (e.g., |
---|
697 | in an If-Match, If-None-Match, or If-Range header field) as cache |
---|
698 | validators, &MUST-NOT; return a response status code of 304 (Not Modified) |
---|
699 | unless doing so is consistent with all of the conditional header |
---|
700 | fields in the request. |
---|
701 | </t> |
---|
702 | <t> |
---|
703 | An HTTP/1.1 caching proxy, upon receiving a conditional request that |
---|
704 | includes both a Last-Modified date and one or more entity-tags as |
---|
705 | cache validators, &MUST-NOT; return a locally cached response to the |
---|
706 | client unless that cached response is consistent with all of the |
---|
707 | conditional header fields in the request. |
---|
708 | <list><t> |
---|
709 | <x:h>Note:</x:h> The general principle behind these rules is that HTTP/1.1 |
---|
710 | servers and clients ought to transmit as much non-redundant |
---|
711 | information as is available in their responses and requests. |
---|
712 | HTTP/1.1 systems receiving this information will make the most |
---|
713 | conservative assumptions about the validators they receive. |
---|
714 | </t><t> |
---|
715 | HTTP/1.0 clients and caches might ignore entity-tags. Generally, |
---|
716 | last-modified values received or used by these systems will |
---|
717 | support transparent and efficient caching, and so HTTP/1.1 origin |
---|
718 | servers should provide Last-Modified values. In those rare cases |
---|
719 | where the use of a Last-Modified value as a validator by an |
---|
720 | HTTP/1.0 system could result in a serious problem, then HTTP/1.1 |
---|
721 | origin servers should not provide one. |
---|
722 | </t></list> |
---|
723 | </t> |
---|
724 | </section> |
---|
725 | </section> |
---|
726 | |
---|
727 | <section title="Precondition Header Fields" anchor="header.field.definitions"> |
---|
728 | <t> |
---|
729 | This section defines the syntax and semantics of HTTP/1.1 header fields |
---|
730 | for applying preconditions on requests. |
---|
731 | </t> |
---|
732 | |
---|
733 | <section title="If-Match" anchor="header.if-match"> |
---|
734 | <iref primary="true" item="If-Match header field" x:for-anchor=""/> |
---|
735 | <iref primary="true" item="Header Fields" subitem="If-Match" x:for-anchor=""/> |
---|
736 | <x:anchor-alias value="If-Match"/> |
---|
737 | <t> |
---|
738 | The "If-Match" header field &MAY; be used to make a request method |
---|
739 | conditional on the current existence or value of an entity-tag for |
---|
740 | one or more representations of the target resource. If-Match is |
---|
741 | generally useful for resource update requests, such as PUT requests, |
---|
742 | as a means for protecting against accidental overwrites when multiple |
---|
743 | clients are acting in parallel on the same resource (i.e., the |
---|
744 | "lost update" problem). An If-Match field-value of "*" places the |
---|
745 | precondition on the existence of any current representation for the |
---|
746 | target resource. |
---|
747 | </t> |
---|
748 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Match"/> |
---|
749 | <x:ref>If-Match</x:ref> = "*" / 1#<x:ref>entity-tag</x:ref> |
---|
750 | </artwork></figure> |
---|
751 | <t> |
---|
752 | If any of the entity-tags listed in the If-Match field value match |
---|
753 | (as per <xref target="entity.tag.comparison"/>) the entity-tag of the |
---|
754 | selected representation for the target resource, |
---|
755 | or if "*" is given and any current representation exists for the |
---|
756 | target resource, then the server &MAY; perform the request method |
---|
757 | as if the If-Match header field was not present. |
---|
758 | </t> |
---|
759 | <t> |
---|
760 | If none of the entity-tags match, or if "*" is given and no current |
---|
761 | representation exists, the server &MUST-NOT; perform the requested method. |
---|
762 | Instead, the server &MUST; respond with the 412 (Precondition Failed) |
---|
763 | status code. |
---|
764 | </t> |
---|
765 | <t> |
---|
766 | If the request would, without the If-Match header field, result in |
---|
767 | anything other than a 2xx or 412 status code, then the If-Match header field |
---|
768 | &MUST; be ignored. |
---|
769 | </t> |
---|
770 | <t> |
---|
771 | Examples: |
---|
772 | </t> |
---|
773 | <figure><artwork type="example"> |
---|
774 | If-Match: "xyzzy" |
---|
775 | If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz" |
---|
776 | If-Match: * |
---|
777 | </artwork></figure> |
---|
778 | <t> |
---|
779 | The result of a request having both an If-Match header field and |
---|
780 | either an If-None-Match or an If-Modified-Since header field is |
---|
781 | undefined by this specification. |
---|
782 | </t> |
---|
783 | </section> |
---|
784 | |
---|
785 | <section title="If-None-Match" anchor="header.if-none-match"> |
---|
786 | <iref primary="true" item="If-None-Match header field" x:for-anchor=""/> |
---|
787 | <iref primary="true" item="Header Fields" subitem="If-None-Match" x:for-anchor=""/> |
---|
788 | <x:anchor-alias value="If-None-Match"/> |
---|
789 | <t> |
---|
790 | The "If-None-Match" header field &MAY; be used to make a request method |
---|
791 | conditional on not matching any of the current entity-tag values for |
---|
792 | representations of the target resource. If-None-Match is primarily |
---|
793 | used in conditional GET requests to enable efficient updates of cached |
---|
794 | information with a minimum amount of transaction overhead. A client |
---|
795 | that has one or more representations previously obtained from the |
---|
796 | target resource can send If-None-Match with a list of the associated |
---|
797 | entity-tags in the hope of receiving a 304 response if at least one |
---|
798 | of those representations matches the selected representation. |
---|
799 | </t> |
---|
800 | <t> |
---|
801 | If-None-Match &MAY; also be used with a value of "*" to prevent an unsafe |
---|
802 | request method (e.g., PUT) from inadvertently modifying an existing |
---|
803 | representation of the target resource when the client believes that |
---|
804 | the resource does not have a current representation. This is a variation |
---|
805 | on the "lost update" problem that might arise if more than one client |
---|
806 | attempts to create an initial representation for the target resource. |
---|
807 | </t> |
---|
808 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-None-Match"/> |
---|
809 | <x:ref>If-None-Match</x:ref> = "*" / 1#<x:ref>entity-tag</x:ref> |
---|
810 | </artwork></figure> |
---|
811 | <t> |
---|
812 | If any of the entity-tags listed in the If-None-Match field-value match |
---|
813 | (as per <xref target="entity.tag.comparison"/>) the entity-tag of the |
---|
814 | selected representation, or if "*" is |
---|
815 | given and any current representation exists for that resource, then the |
---|
816 | server &MUST-NOT; perform the requested method. |
---|
817 | Instead, if the request method was GET or HEAD, the server &SHOULD; |
---|
818 | respond with a 304 (Not Modified) status code, including the cache-related |
---|
819 | header fields (particularly ETag) of the selected representation that has |
---|
820 | a matching entity-tag. For all other request methods, the server &MUST; |
---|
821 | respond with a 412 (Precondition Failed) status code. |
---|
822 | </t> |
---|
823 | <t> |
---|
824 | If none of the entity-tags match, then the server &MAY; perform the |
---|
825 | requested method as if the If-None-Match header field did not exist, |
---|
826 | but &MUST; also ignore any If-Modified-Since header field(s) in the |
---|
827 | request. That is, if no entity-tags match, then the server &MUST-NOT; |
---|
828 | return a 304 (Not Modified) response. |
---|
829 | </t> |
---|
830 | <t> |
---|
831 | If the request would, without the If-None-Match header field, result |
---|
832 | in anything other than a 2xx or 304 status code, then the If-None-Match |
---|
833 | header field &MUST; be ignored. (See <xref |
---|
834 | target="rules.for.when.to.use.entity.tags.and.last-modified.dates"/> for |
---|
835 | a discussion of server behavior when both If-Modified-Since and |
---|
836 | If-None-Match appear in the same request.) |
---|
837 | </t> |
---|
838 | <t> |
---|
839 | Examples: |
---|
840 | </t> |
---|
841 | <figure><artwork type="example"> |
---|
842 | If-None-Match: "xyzzy" |
---|
843 | If-None-Match: W/"xyzzy" |
---|
844 | If-None-Match: "xyzzy", "r2d2xxxx", "c3piozzzz" |
---|
845 | If-None-Match: W/"xyzzy", W/"r2d2xxxx", W/"c3piozzzz" |
---|
846 | If-None-Match: * |
---|
847 | </artwork></figure> |
---|
848 | <t> |
---|
849 | The result of a request having both an If-None-Match header field and |
---|
850 | either an If-Match or an If-Unmodified-Since header field is |
---|
851 | undefined by this specification. |
---|
852 | </t> |
---|
853 | </section> |
---|
854 | |
---|
855 | <section title="If-Modified-Since" anchor="header.if-modified-since"> |
---|
856 | <iref primary="true" item="If-Modified-Since header field" x:for-anchor=""/> |
---|
857 | <iref primary="true" item="Header Fields" subitem="If-Modified-Since" x:for-anchor=""/> |
---|
858 | <x:anchor-alias value="If-Modified-Since"/> |
---|
859 | <t> |
---|
860 | The "If-Modified-Since" header field &MAY; be used to make a request |
---|
861 | method conditional by modification date: if the selected representation |
---|
862 | has not been modified since the time specified in this field, then |
---|
863 | do not perform the request method; instead, respond as detailed below. |
---|
864 | </t> |
---|
865 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Modified-Since"/> |
---|
866 | <x:ref>If-Modified-Since</x:ref> = <x:ref>HTTP-date</x:ref> |
---|
867 | </artwork></figure> |
---|
868 | <t> |
---|
869 | An example of the field is: |
---|
870 | </t> |
---|
871 | <figure><artwork type="example"> |
---|
872 | If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT |
---|
873 | </artwork></figure> |
---|
874 | <t> |
---|
875 | A GET method with an If-Modified-Since header field and no Range header |
---|
876 | field requests that the selected representation be transferred only if |
---|
877 | it has been modified since the date given by the If-Modified-Since |
---|
878 | header field. |
---|
879 | The algorithm for determining this includes the following cases: |
---|
880 | <list style="numbers"> |
---|
881 | <t>If the request would normally result in anything other than a |
---|
882 | 200 (OK) status code, or if the passed If-Modified-Since date is |
---|
883 | invalid, the response is exactly the same as for a normal GET. |
---|
884 | A date which is later than the server's current time is |
---|
885 | invalid.</t> |
---|
886 | |
---|
887 | <t>If the selected representation has been modified since the |
---|
888 | If-Modified-Since date, the response is exactly the same as for |
---|
889 | a normal GET.</t> |
---|
890 | |
---|
891 | <t>If the selected representation has not been modified since a valid |
---|
892 | If-Modified-Since date, the server &SHOULD; return a |
---|
893 | 304 (Not Modified) response.</t> |
---|
894 | </list> |
---|
895 | </t> |
---|
896 | <t> |
---|
897 | The purpose of this feature is to allow efficient updates of cached |
---|
898 | information with a minimum amount of transaction overhead. |
---|
899 | <list><t> |
---|
900 | <x:h>Note:</x:h> The Range header field modifies the meaning of If-Modified-Since; |
---|
901 | see &header-range; for full details. |
---|
902 | </t><t> |
---|
903 | <x:h>Note:</x:h> If-Modified-Since times are interpreted by the server, whose |
---|
904 | clock might not be synchronized with the client. |
---|
905 | </t><t> |
---|
906 | <x:h>Note:</x:h> When handling an If-Modified-Since header field, some |
---|
907 | servers will use an exact date comparison function, rather than a |
---|
908 | less-than function, for deciding whether to send a 304 (Not |
---|
909 | Modified) response. To get best results when sending an If-Modified-Since |
---|
910 | header field for cache validation, clients are |
---|
911 | advised to use the exact date string received in a previous Last-Modified |
---|
912 | header field whenever possible. |
---|
913 | </t><t> |
---|
914 | <x:h>Note:</x:h> If a client uses an arbitrary date in the If-Modified-Since |
---|
915 | header field instead of a date taken from the Last-Modified header field for |
---|
916 | the same request, the client needs to be aware that this |
---|
917 | date is interpreted in the server's understanding of time. |
---|
918 | Unsynchronized clocks and rounding problems, due to the different |
---|
919 | encodings of time between the client and server, are concerns. |
---|
920 | This includes the possibility of race conditions if the |
---|
921 | document has changed between the time it was first requested and |
---|
922 | the If-Modified-Since date of a subsequent request, and the |
---|
923 | possibility of clock-skew-related problems if the If-Modified-Since |
---|
924 | date is derived from the client's clock without correction |
---|
925 | to the server's clock. Corrections for different time bases |
---|
926 | between client and server are at best approximate due to network |
---|
927 | latency. |
---|
928 | </t> |
---|
929 | </list> |
---|
930 | </t> |
---|
931 | <t> |
---|
932 | The result of a request having both an If-Modified-Since header field |
---|
933 | and either an If-Match or an If-Unmodified-Since header field is |
---|
934 | undefined by this specification. |
---|
935 | </t> |
---|
936 | </section> |
---|
937 | |
---|
938 | <section title="If-Unmodified-Since" anchor="header.if-unmodified-since"> |
---|
939 | <iref primary="true" item="If-Unmodified-Since header field" x:for-anchor=""/> |
---|
940 | <iref primary="true" item="Header Fields" subitem="If-Unmodified-Since" x:for-anchor=""/> |
---|
941 | <x:anchor-alias value="If-Unmodified-Since"/> |
---|
942 | <t> |
---|
943 | The "If-Unmodified-Since" header field &MAY; be used to make a request |
---|
944 | method conditional by modification date: if the selected representation |
---|
945 | has been modified since the time specified in this field, then the |
---|
946 | server &MUST-NOT; perform the requested operation and &MUST; instead |
---|
947 | respond with the 412 (Precondition Failed) status code. |
---|
948 | If the selected representation has not been modified since the time |
---|
949 | specified in this field, the server &SHOULD; perform the request |
---|
950 | method as if the If-Unmodified-Since header field were not present. |
---|
951 | </t> |
---|
952 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Unmodified-Since"/> |
---|
953 | <x:ref>If-Unmodified-Since</x:ref> = <x:ref>HTTP-date</x:ref> |
---|
954 | </artwork></figure> |
---|
955 | <t> |
---|
956 | An example of the field is: |
---|
957 | </t> |
---|
958 | <figure><artwork type="example"> |
---|
959 | If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT |
---|
960 | </artwork></figure> |
---|
961 | <t> |
---|
962 | If the request normally (i.e., without the If-Unmodified-Since |
---|
963 | header field) would result in anything other than a 2xx or 412 status code, |
---|
964 | the If-Unmodified-Since header field &SHOULD; be ignored. |
---|
965 | </t> |
---|
966 | <t> |
---|
967 | If the specified date is invalid, the header field &MUST; be ignored. |
---|
968 | </t> |
---|
969 | <t> |
---|
970 | The result of a request having both an If-Unmodified-Since header |
---|
971 | field and either an If-None-Match or an If-Modified-Since header |
---|
972 | field is undefined by this specification. |
---|
973 | </t> |
---|
974 | </section> |
---|
975 | |
---|
976 | <section title="If-Range" anchor="header.if-range"> |
---|
977 | <t> |
---|
978 | The If-Range header field provides a special conditional request |
---|
979 | mechanism that is similar to If-Match and If-Unmodified-Since but |
---|
980 | specific to HTTP range requests. If-Range is defined in &header-if-range;. |
---|
981 | </t> |
---|
982 | </section> |
---|
983 | |
---|
984 | </section> |
---|
985 | |
---|
986 | <section title="Status Code Definitions" anchor="status.code.definitions"> |
---|
987 | <section title="304 Not Modified" anchor="status.304"> |
---|
988 | <iref primary="true" item="304 Not Modified (status code)" x:for-anchor=""/> |
---|
989 | <iref primary="true" item="Status Codes" subitem="304 Not Modified" x:for-anchor=""/> |
---|
990 | <t> |
---|
991 | The 304 status code indicates that a conditional GET request has been |
---|
992 | received and would have resulted in a 200 (OK) response if it were not |
---|
993 | for the fact that the condition has evaluated to false. In other words, |
---|
994 | there is no need for the server to transfer a representation of the |
---|
995 | target resource because the client's request indicates that it already |
---|
996 | has a valid representation, as indicated by the 304 response header |
---|
997 | fields, and is therefore redirecting the client to make use of that |
---|
998 | stored representation as if it were the payload of a 200 response. |
---|
999 | The 304 response &MUST-NOT; contain a message-body, and thus is always |
---|
1000 | terminated by the first empty line after the header fields. |
---|
1001 | </t> |
---|
1002 | <t> |
---|
1003 | A 304 response &MUST; include a Date header field (&header-date;) |
---|
1004 | unless the origin server does not have a clock that can provide a |
---|
1005 | reasonable approximation of the current time. If a 200 response |
---|
1006 | to the same request would have included any of the header fields |
---|
1007 | Cache-Control, Content-Location, ETag, Expires, or Vary, then |
---|
1008 | those same header fields &MUST; be sent in a 304 response. |
---|
1009 | </t> |
---|
1010 | <t> |
---|
1011 | Since the goal of a 304 response is to minimize information transfer |
---|
1012 | when the recipient already has one or more cached representations, |
---|
1013 | the response &SHOULD-NOT; include representation metadata other |
---|
1014 | than the above listed fields unless said metadata exists for the |
---|
1015 | purpose of guiding cache updates (e.g., future HTTP extensions). |
---|
1016 | </t> |
---|
1017 | <t> |
---|
1018 | If the recipient of a 304 response does not have a cached representation |
---|
1019 | corresponding to the entity-tag indicated by the 304 response, then the |
---|
1020 | recipient &MUST-NOT; use the 304 to update its own cache. If this |
---|
1021 | conditional request originated with an outbound client, such as a |
---|
1022 | user agent with its own cache sending a conditional GET to a shared |
---|
1023 | proxy, then the 304 response &MAY; be forwarded to the outbound client. |
---|
1024 | Otherwise, the recipient &MUST; disregard the 304 response and repeat |
---|
1025 | the request without any preconditions. |
---|
1026 | </t> |
---|
1027 | <t> |
---|
1028 | If a cache uses a received 304 response to update a cache entry, the |
---|
1029 | cache &MUST; update the entry to reflect any new field values given in |
---|
1030 | the response. |
---|
1031 | </t> |
---|
1032 | </section> |
---|
1033 | |
---|
1034 | <section title="412 Precondition Failed" anchor="status.412"> |
---|
1035 | <iref primary="true" item="412 Precondition Failed (status code)" x:for-anchor=""/> |
---|
1036 | <iref primary="true" item="Status Codes" subitem="412 Precondition Failed" x:for-anchor=""/> |
---|
1037 | <t> |
---|
1038 | The 412 status code indicates that one or more preconditions given in |
---|
1039 | the request header fields evaluated to false when tested on the server. |
---|
1040 | This response code allows the client to place preconditions on the |
---|
1041 | current resource state (its current representations and metadata) |
---|
1042 | and thus prevent the request method from being applied if the target |
---|
1043 | resource is in an unexpected state. |
---|
1044 | </t> |
---|
1045 | </section> |
---|
1046 | </section> |
---|
1047 | |
---|
1048 | <section title="IANA Considerations" anchor="IANA.considerations"> |
---|
1049 | |
---|
1050 | <section title="Status Code Registration" anchor="status.code.registration"> |
---|
1051 | <t> |
---|
1052 | The HTTP Status Code Registry located at <eref target="http://www.iana.org/assignments/http-status-codes"/> |
---|
1053 | shall be updated with the registrations below: |
---|
1054 | </t> |
---|
1055 | <?BEGININC p4-conditional.iana-status-codes ?> |
---|
1056 | <!--AUTOGENERATED FROM extract-status-code-defs.xslt, do not edit manually--> |
---|
1057 | <texttable align="left" suppress-title="true" anchor="iana.status.code.registration.table"> |
---|
1058 | <ttcol>Value</ttcol> |
---|
1059 | <ttcol>Description</ttcol> |
---|
1060 | <ttcol>Reference</ttcol> |
---|
1061 | <c>304</c> |
---|
1062 | <c>Not Modified</c> |
---|
1063 | <c> |
---|
1064 | <xref target="status.304"/> |
---|
1065 | </c> |
---|
1066 | <c>412</c> |
---|
1067 | <c>Precondition Failed</c> |
---|
1068 | <c> |
---|
1069 | <xref target="status.412"/> |
---|
1070 | </c> |
---|
1071 | </texttable> |
---|
1072 | <!--(END)--> |
---|
1073 | <?ENDINC p4-conditional.iana-status-codes ?> |
---|
1074 | </section> |
---|
1075 | |
---|
1076 | <section title="Header Field Registration" anchor="header.field.registration"> |
---|
1077 | <t> |
---|
1078 | The Message Header Field Registry located at <eref target="http://www.iana.org/assignments/message-headers/message-header-index.html"/> shall be updated |
---|
1079 | with the permanent registrations below (see <xref target="RFC3864"/>): |
---|
1080 | </t> |
---|
1081 | <?BEGININC p4-conditional.iana-headers ?> |
---|
1082 | <!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually--> |
---|
1083 | <texttable align="left" suppress-title="true" anchor="iana.header.registration.table"> |
---|
1084 | <ttcol>Header Field Name</ttcol> |
---|
1085 | <ttcol>Protocol</ttcol> |
---|
1086 | <ttcol>Status</ttcol> |
---|
1087 | <ttcol>Reference</ttcol> |
---|
1088 | |
---|
1089 | <c>ETag</c> |
---|
1090 | <c>http</c> |
---|
1091 | <c>standard</c> |
---|
1092 | <c> |
---|
1093 | <xref target="header.etag"/> |
---|
1094 | </c> |
---|
1095 | <c>If-Match</c> |
---|
1096 | <c>http</c> |
---|
1097 | <c>standard</c> |
---|
1098 | <c> |
---|
1099 | <xref target="header.if-match"/> |
---|
1100 | </c> |
---|
1101 | <c>If-Modified-Since</c> |
---|
1102 | <c>http</c> |
---|
1103 | <c>standard</c> |
---|
1104 | <c> |
---|
1105 | <xref target="header.if-modified-since"/> |
---|
1106 | </c> |
---|
1107 | <c>If-None-Match</c> |
---|
1108 | <c>http</c> |
---|
1109 | <c>standard</c> |
---|
1110 | <c> |
---|
1111 | <xref target="header.if-none-match"/> |
---|
1112 | </c> |
---|
1113 | <c>If-Unmodified-Since</c> |
---|
1114 | <c>http</c> |
---|
1115 | <c>standard</c> |
---|
1116 | <c> |
---|
1117 | <xref target="header.if-unmodified-since"/> |
---|
1118 | </c> |
---|
1119 | <c>Last-Modified</c> |
---|
1120 | <c>http</c> |
---|
1121 | <c>standard</c> |
---|
1122 | <c> |
---|
1123 | <xref target="header.last-modified"/> |
---|
1124 | </c> |
---|
1125 | </texttable> |
---|
1126 | <!--(END)--> |
---|
1127 | <?ENDINC p4-conditional.iana-headers ?> |
---|
1128 | <t> |
---|
1129 | The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force". |
---|
1130 | </t> |
---|
1131 | </section> |
---|
1132 | </section> |
---|
1133 | |
---|
1134 | <section title="Security Considerations" anchor="security.considerations"> |
---|
1135 | <t> |
---|
1136 | No additional security considerations have been identified beyond |
---|
1137 | those applicable to HTTP in general &messaging;. |
---|
1138 | </t> |
---|
1139 | </section> |
---|
1140 | |
---|
1141 | <section title="Acknowledgments" anchor="acks"> |
---|
1142 | <t> |
---|
1143 | See &acks;. |
---|
1144 | </t> |
---|
1145 | </section> |
---|
1146 | </middle> |
---|
1147 | <back> |
---|
1148 | |
---|
1149 | <references title="Normative References"> |
---|
1150 | |
---|
1151 | <reference anchor="Part1"> |
---|
1152 | <front> |
---|
1153 | <title abbrev="HTTP/1.1">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</title> |
---|
1154 | <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor"> |
---|
1155 | <organization abbrev="Adobe">Adobe Systems Incorporated</organization> |
---|
1156 | <address><email>fielding@gbiv.com</email></address> |
---|
1157 | </author> |
---|
1158 | <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor"> |
---|
1159 | <organization abbrev="W3C">World Wide Web Consortium</organization> |
---|
1160 | <address><email>ylafon@w3.org</email></address> |
---|
1161 | </author> |
---|
1162 | <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor"> |
---|
1163 | <organization abbrev="greenbytes">greenbytes GmbH</organization> |
---|
1164 | <address><email>julian.reschke@greenbytes.de</email></address> |
---|
1165 | </author> |
---|
1166 | <date month="&ID-MONTH;" year="&ID-YEAR;"/> |
---|
1167 | </front> |
---|
1168 | <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"/> |
---|
1169 | <x:source href="p1-messaging.xml" basename="p1-messaging"/> |
---|
1170 | </reference> |
---|
1171 | |
---|
1172 | <reference anchor="Part2"> |
---|
1173 | <front> |
---|
1174 | <title abbrev="HTTP/1.1">HTTP/1.1, part 2: Message Semantics</title> |
---|
1175 | <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor"> |
---|
1176 | <organization abbrev="Adobe">Adobe Systems Incorporated</organization> |
---|
1177 | <address><email>fielding@gbiv.com</email></address> |
---|
1178 | </author> |
---|
1179 | <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor"> |
---|
1180 | <organization abbrev="W3C">World Wide Web Consortium</organization> |
---|
1181 | <address><email>ylafon@w3.org</email></address> |
---|
1182 | </author> |
---|
1183 | <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor"> |
---|
1184 | <organization abbrev="greenbytes">greenbytes GmbH</organization> |
---|
1185 | <address><email>julian.reschke@greenbytes.de</email></address> |
---|
1186 | </author> |
---|
1187 | <date month="&ID-MONTH;" year="&ID-YEAR;"/> |
---|
1188 | </front> |
---|
1189 | <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p2-semantics-&ID-VERSION;"/> |
---|
1190 | <x:source href="p2-semantics.xml" basename="p2-semantics"/> |
---|
1191 | </reference> |
---|
1192 | |
---|
1193 | <reference anchor="Part3"> |
---|
1194 | <front> |
---|
1195 | <title abbrev="HTTP/1.1">HTTP/1.1, part 3: Message Payload and Content Negotiation</title> |
---|
1196 | <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor"> |
---|
1197 | <organization abbrev="Adobe">Adobe Systems Incorporated</organization> |
---|
1198 | <address><email>fielding@gbiv.com</email></address> |
---|
1199 | </author> |
---|
1200 | <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor"> |
---|
1201 | <organization abbrev="W3C">World Wide Web Consortium</organization> |
---|
1202 | <address><email>ylafon@w3.org</email></address> |
---|
1203 | </author> |
---|
1204 | <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor"> |
---|
1205 | <organization abbrev="greenbytes">greenbytes GmbH</organization> |
---|
1206 | <address><email>julian.reschke@greenbytes.de</email></address> |
---|
1207 | </author> |
---|
1208 | <date month="&ID-MONTH;" year="&ID-YEAR;"/> |
---|
1209 | </front> |
---|
1210 | <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p3-payload-&ID-VERSION;"/> |
---|
1211 | <x:source href="p3-payload.xml" basename="p3-payload"/> |
---|
1212 | </reference> |
---|
1213 | |
---|
1214 | <reference anchor="Part5"> |
---|
1215 | <front> |
---|
1216 | <title abbrev="HTTP/1.1">HTTP/1.1, part 5: Range Requests and Partial Responses</title> |
---|
1217 | <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor"> |
---|
1218 | <organization abbrev="Adobe">Adobe Systems Incorporated</organization> |
---|
1219 | <address><email>fielding@gbiv.com</email></address> |
---|
1220 | </author> |
---|
1221 | <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor"> |
---|
1222 | <organization abbrev="W3C">World Wide Web Consortium</organization> |
---|
1223 | <address><email>ylafon@w3.org</email></address> |
---|
1224 | </author> |
---|
1225 | <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor"> |
---|
1226 | <organization abbrev="greenbytes">greenbytes GmbH</organization> |
---|
1227 | <address><email>julian.reschke@greenbytes.de</email></address> |
---|
1228 | </author> |
---|
1229 | <date month="&ID-MONTH;" year="&ID-YEAR;"/> |
---|
1230 | </front> |
---|
1231 | <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p5-range-&ID-VERSION;"/> |
---|
1232 | <x:source href="p5-range.xml" basename="p5-range"/> |
---|
1233 | </reference> |
---|
1234 | |
---|
1235 | <reference anchor="Part6"> |
---|
1236 | <front> |
---|
1237 | <title abbrev="HTTP/1.1">HTTP/1.1, part 6: Caching</title> |
---|
1238 | <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor"> |
---|
1239 | <organization abbrev="Adobe">Adobe Systems Incorporated</organization> |
---|
1240 | <address><email>fielding@gbiv.com</email></address> |
---|
1241 | </author> |
---|
1242 | <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor"> |
---|
1243 | <organization abbrev="W3C">World Wide Web Consortium</organization> |
---|
1244 | <address><email>ylafon@w3.org</email></address> |
---|
1245 | </author> |
---|
1246 | <author initials="M." surname="Nottingham" fullname="Mark Nottingham" role="editor"> |
---|
1247 | <organization>Rackspace</organization> |
---|
1248 | <address><email>mnot@mnot.net</email></address> |
---|
1249 | </author> |
---|
1250 | <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor"> |
---|
1251 | <organization abbrev="greenbytes">greenbytes GmbH</organization> |
---|
1252 | <address><email>julian.reschke@greenbytes.de</email></address> |
---|
1253 | </author> |
---|
1254 | <date month="&ID-MONTH;" year="&ID-YEAR;"/> |
---|
1255 | </front> |
---|
1256 | <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-&ID-VERSION;"/> |
---|
1257 | <x:source href="p6-cache.xml" basename="p6-cache"/> |
---|
1258 | </reference> |
---|
1259 | |
---|
1260 | <reference anchor="RFC2119"> |
---|
1261 | <front> |
---|
1262 | <title>Key words for use in RFCs to Indicate Requirement Levels</title> |
---|
1263 | <author initials="S." surname="Bradner" fullname="Scott Bradner"> |
---|
1264 | <organization>Harvard University</organization> |
---|
1265 | <address><email>sob@harvard.edu</email></address> |
---|
1266 | </author> |
---|
1267 | <date month="March" year="1997"/> |
---|
1268 | </front> |
---|
1269 | <seriesInfo name="BCP" value="14"/> |
---|
1270 | <seriesInfo name="RFC" value="2119"/> |
---|
1271 | </reference> |
---|
1272 | |
---|
1273 | <reference anchor="RFC5234"> |
---|
1274 | <front> |
---|
1275 | <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title> |
---|
1276 | <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor"> |
---|
1277 | <organization>Brandenburg InternetWorking</organization> |
---|
1278 | <address> |
---|
1279 | <email>dcrocker@bbiw.net</email> |
---|
1280 | </address> |
---|
1281 | </author> |
---|
1282 | <author initials="P." surname="Overell" fullname="Paul Overell"> |
---|
1283 | <organization>THUS plc.</organization> |
---|
1284 | <address> |
---|
1285 | <email>paul.overell@thus.net</email> |
---|
1286 | </address> |
---|
1287 | </author> |
---|
1288 | <date month="January" year="2008"/> |
---|
1289 | </front> |
---|
1290 | <seriesInfo name="STD" value="68"/> |
---|
1291 | <seriesInfo name="RFC" value="5234"/> |
---|
1292 | </reference> |
---|
1293 | |
---|
1294 | </references> |
---|
1295 | |
---|
1296 | <references title="Informative References"> |
---|
1297 | |
---|
1298 | <reference anchor="RFC2616"> |
---|
1299 | <front> |
---|
1300 | <title>Hypertext Transfer Protocol -- HTTP/1.1</title> |
---|
1301 | <author initials="R." surname="Fielding" fullname="R. Fielding"> |
---|
1302 | <organization>University of California, Irvine</organization> |
---|
1303 | <address><email>fielding@ics.uci.edu</email></address> |
---|
1304 | </author> |
---|
1305 | <author initials="J." surname="Gettys" fullname="J. Gettys"> |
---|
1306 | <organization>W3C</organization> |
---|
1307 | <address><email>jg@w3.org</email></address> |
---|
1308 | </author> |
---|
1309 | <author initials="J." surname="Mogul" fullname="J. Mogul"> |
---|
1310 | <organization>Compaq Computer Corporation</organization> |
---|
1311 | <address><email>mogul@wrl.dec.com</email></address> |
---|
1312 | </author> |
---|
1313 | <author initials="H." surname="Frystyk" fullname="H. Frystyk"> |
---|
1314 | <organization>MIT Laboratory for Computer Science</organization> |
---|
1315 | <address><email>frystyk@w3.org</email></address> |
---|
1316 | </author> |
---|
1317 | <author initials="L." surname="Masinter" fullname="L. Masinter"> |
---|
1318 | <organization>Xerox Corporation</organization> |
---|
1319 | <address><email>masinter@parc.xerox.com</email></address> |
---|
1320 | </author> |
---|
1321 | <author initials="P." surname="Leach" fullname="P. Leach"> |
---|
1322 | <organization>Microsoft Corporation</organization> |
---|
1323 | <address><email>paulle@microsoft.com</email></address> |
---|
1324 | </author> |
---|
1325 | <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee"> |
---|
1326 | <organization>W3C</organization> |
---|
1327 | <address><email>timbl@w3.org</email></address> |
---|
1328 | </author> |
---|
1329 | <date month="June" year="1999"/> |
---|
1330 | </front> |
---|
1331 | <seriesInfo name="RFC" value="2616"/> |
---|
1332 | </reference> |
---|
1333 | |
---|
1334 | <reference anchor='RFC3864'> |
---|
1335 | <front> |
---|
1336 | <title>Registration Procedures for Message Header Fields</title> |
---|
1337 | <author initials='G.' surname='Klyne' fullname='G. Klyne'> |
---|
1338 | <organization>Nine by Nine</organization> |
---|
1339 | <address><email>GK-IETF@ninebynine.org</email></address> |
---|
1340 | </author> |
---|
1341 | <author initials='M.' surname='Nottingham' fullname='M. Nottingham'> |
---|
1342 | <organization>BEA Systems</organization> |
---|
1343 | <address><email>mnot@pobox.com</email></address> |
---|
1344 | </author> |
---|
1345 | <author initials='J.' surname='Mogul' fullname='J. Mogul'> |
---|
1346 | <organization>HP Labs</organization> |
---|
1347 | <address><email>JeffMogul@acm.org</email></address> |
---|
1348 | </author> |
---|
1349 | <date year='2004' month='September' /> |
---|
1350 | </front> |
---|
1351 | <seriesInfo name='BCP' value='90' /> |
---|
1352 | <seriesInfo name='RFC' value='3864' /> |
---|
1353 | </reference> |
---|
1354 | |
---|
1355 | <reference anchor='RFC4918'> |
---|
1356 | <front> |
---|
1357 | <title>HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)</title> |
---|
1358 | <author initials="L.M." surname="Dusseault" fullname="Lisa Dusseault" role="editor" > |
---|
1359 | <organization abbrev="CommerceNet">CommerceNet</organization> |
---|
1360 | <address><email>ldusseault@commerce.net</email></address> |
---|
1361 | </author> |
---|
1362 | <date month="June" year="2007" /> |
---|
1363 | </front> |
---|
1364 | <seriesInfo name='RFC' value='4918' /> |
---|
1365 | </reference> |
---|
1366 | </references> |
---|
1367 | |
---|
1368 | <section title="Changes from RFC 2616" anchor="changes.from.rfc.2616"> |
---|
1369 | <t> |
---|
1370 | Allow weak entity-tags in all requests except range requests (Sections |
---|
1371 | <xref target="weak.and.strong.validators" format="counter"/> and |
---|
1372 | <xref target="header.if-none-match" format="counter"/>). |
---|
1373 | </t> |
---|
1374 | <t> |
---|
1375 | Change ETag header field ABNF not to use quoted-string, thus avoiding |
---|
1376 | escaping issues. |
---|
1377 | (<xref target="header.etag"/>) |
---|
1378 | </t> |
---|
1379 | <t> |
---|
1380 | Change ABNF productions for header fields to only define the field value. |
---|
1381 | (<xref target="header.field.definitions"/>) |
---|
1382 | </t> |
---|
1383 | </section> |
---|
1384 | |
---|
1385 | <?BEGININC p4-conditional.abnf-appendix ?> |
---|
1386 | <section xmlns:x="http://purl.org/net/xml2rfc/ext" title="Collected ABNF" anchor="collected.abnf"> |
---|
1387 | <figure> |
---|
1388 | <artwork type="abnf" name="p4-conditional.parsed-abnf"> |
---|
1389 | <x:ref>ETag</x:ref> = entity-tag |
---|
1390 | |
---|
1391 | <x:ref>HTTP-date</x:ref> = <HTTP-date, defined in [Part2], Section 8> |
---|
1392 | |
---|
1393 | <x:ref>If-Match</x:ref> = "*" / ( *( "," OWS ) entity-tag *( OWS "," [ OWS |
---|
1394 | entity-tag ] ) ) |
---|
1395 | <x:ref>If-Modified-Since</x:ref> = HTTP-date |
---|
1396 | <x:ref>If-None-Match</x:ref> = "*" / ( *( "," OWS ) entity-tag *( OWS "," [ OWS |
---|
1397 | entity-tag ] ) ) |
---|
1398 | <x:ref>If-Unmodified-Since</x:ref> = HTTP-date |
---|
1399 | |
---|
1400 | <x:ref>Last-Modified</x:ref> = HTTP-date |
---|
1401 | |
---|
1402 | <x:ref>OWS</x:ref> = <OWS, defined in [Part1], Section 3.2.1> |
---|
1403 | |
---|
1404 | <x:ref>entity-tag</x:ref> = [ weak ] opaque-tag |
---|
1405 | <x:ref>etagc</x:ref> = "!" / %x23-7E ; '#'-'~' |
---|
1406 | / obs-text |
---|
1407 | |
---|
1408 | <x:ref>obs-text</x:ref> = <obs-text, defined in [Part1], Section 3.2.4> |
---|
1409 | <x:ref>opaque-tag</x:ref> = DQUOTE *etagc DQUOTE |
---|
1410 | |
---|
1411 | <x:ref>weak</x:ref> = %x57.2F ; W/ |
---|
1412 | </artwork> |
---|
1413 | </figure> |
---|
1414 | <figure><preamble>ABNF diagnostics:</preamble><artwork type="inline"> |
---|
1415 | ; ETag defined but not used |
---|
1416 | ; If-Match defined but not used |
---|
1417 | ; If-Modified-Since defined but not used |
---|
1418 | ; If-None-Match defined but not used |
---|
1419 | ; If-Unmodified-Since defined but not used |
---|
1420 | ; Last-Modified defined but not used |
---|
1421 | </artwork></figure></section> |
---|
1422 | <?ENDINC p4-conditional.abnf-appendix ?> |
---|
1423 | |
---|
1424 | <section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log"> |
---|
1425 | |
---|
1426 | <section title="Since RFC 2616"> |
---|
1427 | <t> |
---|
1428 | Extracted relevant partitions from <xref target="RFC2616"/>. |
---|
1429 | </t> |
---|
1430 | </section> |
---|
1431 | |
---|
1432 | <section title="Since draft-ietf-httpbis-p4-conditional-00"> |
---|
1433 | <t> |
---|
1434 | Closed issues: |
---|
1435 | <list style="symbols"> |
---|
1436 | <t> |
---|
1437 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/35"/>: |
---|
1438 | "Normative and Informative references" |
---|
1439 | </t> |
---|
1440 | </list> |
---|
1441 | </t> |
---|
1442 | <t> |
---|
1443 | Other changes: |
---|
1444 | <list style="symbols"> |
---|
1445 | <t> |
---|
1446 | Move definitions of 304 and 412 condition codes from Part2. |
---|
1447 | </t> |
---|
1448 | </list> |
---|
1449 | </t> |
---|
1450 | </section> |
---|
1451 | |
---|
1452 | <section title="Since draft-ietf-httpbis-p4-conditional-01"> |
---|
1453 | <t> |
---|
1454 | Ongoing work on ABNF conversion (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/36"/>): |
---|
1455 | <list style="symbols"> |
---|
1456 | <t> |
---|
1457 | Add explicit references to BNF syntax and rules imported from other parts of the specification. |
---|
1458 | </t> |
---|
1459 | </list> |
---|
1460 | </t> |
---|
1461 | </section> |
---|
1462 | |
---|
1463 | <section title="Since draft-ietf-httpbis-p4-conditional-02" anchor="changes.since.02"> |
---|
1464 | <t> |
---|
1465 | Closed issues: |
---|
1466 | <list style="symbols"> |
---|
1467 | <t> |
---|
1468 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/116"/>: |
---|
1469 | "Weak ETags on non-GET requests" |
---|
1470 | </t> |
---|
1471 | </list> |
---|
1472 | </t> |
---|
1473 | <t> |
---|
1474 | Ongoing work on IANA Message Header Field Registration (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/40"/>): |
---|
1475 | <list style="symbols"> |
---|
1476 | <t> |
---|
1477 | Reference RFC 3984, and update header field registrations for header fields defined |
---|
1478 | in this document. |
---|
1479 | </t> |
---|
1480 | </list> |
---|
1481 | </t> |
---|
1482 | </section> |
---|
1483 | |
---|
1484 | <section title="Since draft-ietf-httpbis-p4-conditional-03" anchor="changes.since.03"> |
---|
1485 | <t> |
---|
1486 | Closed issues: |
---|
1487 | <list style="symbols"> |
---|
1488 | <t> |
---|
1489 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/71"/>: |
---|
1490 | "Examples for ETag matching" |
---|
1491 | </t> |
---|
1492 | <t> |
---|
1493 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/124"/>: |
---|
1494 | "'entity value' undefined" |
---|
1495 | </t> |
---|
1496 | <t> |
---|
1497 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/126"/>: |
---|
1498 | "bogus 2068 Date header reference" |
---|
1499 | </t> |
---|
1500 | </list> |
---|
1501 | </t> |
---|
1502 | </section> |
---|
1503 | |
---|
1504 | <section title="Since draft-ietf-httpbis-p4-conditional-04" anchor="changes.since.04"> |
---|
1505 | <t> |
---|
1506 | Ongoing work on ABNF conversion (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/36"/>): |
---|
1507 | <list style="symbols"> |
---|
1508 | <t> |
---|
1509 | Use "/" instead of "|" for alternatives. |
---|
1510 | </t> |
---|
1511 | <t> |
---|
1512 | Introduce new ABNF rules for "bad" whitespace ("BWS"), optional |
---|
1513 | whitespace ("OWS") and required whitespace ("RWS"). |
---|
1514 | </t> |
---|
1515 | <t> |
---|
1516 | Rewrite ABNFs to spell out whitespace rules, factor out |
---|
1517 | header field value format definitions. |
---|
1518 | </t> |
---|
1519 | </list> |
---|
1520 | </t> |
---|
1521 | </section> |
---|
1522 | |
---|
1523 | <section title="Since draft-ietf-httpbis-p4-conditional-05" anchor="changes.since.05"> |
---|
1524 | <t> |
---|
1525 | Final work on ABNF conversion (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/36"/>): |
---|
1526 | <list style="symbols"> |
---|
1527 | <t> |
---|
1528 | Add appendix containing collected and expanded ABNF, reorganize ABNF introduction. |
---|
1529 | </t> |
---|
1530 | </list> |
---|
1531 | </t> |
---|
1532 | </section> |
---|
1533 | |
---|
1534 | <section title="Since draft-ietf-httpbis-p4-conditional-06" anchor="changes.since.06"> |
---|
1535 | <t> |
---|
1536 | Closed issues: |
---|
1537 | <list style="symbols"> |
---|
1538 | <t> |
---|
1539 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/153"/>: |
---|
1540 | "case-sensitivity of etag weakness indicator" |
---|
1541 | </t> |
---|
1542 | </list> |
---|
1543 | </t> |
---|
1544 | </section> |
---|
1545 | |
---|
1546 | <section title="Since draft-ietf-httpbis-p4-conditional-07" anchor="changes.since.07"> |
---|
1547 | <t> |
---|
1548 | Closed issues: |
---|
1549 | <list style="symbols"> |
---|
1550 | <t> |
---|
1551 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/116"/>: |
---|
1552 | "Weak ETags on non-GET requests" (If-Match still was defined to require |
---|
1553 | strong matching) |
---|
1554 | </t> |
---|
1555 | <t> |
---|
1556 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/198"/>: |
---|
1557 | "move IANA registrations for optional status codes" |
---|
1558 | </t> |
---|
1559 | </list> |
---|
1560 | </t> |
---|
1561 | </section> |
---|
1562 | |
---|
1563 | <section title="Since draft-ietf-httpbis-p4-conditional-08" anchor="changes.since.08"> |
---|
1564 | <t> |
---|
1565 | No significant changes. |
---|
1566 | </t> |
---|
1567 | </section> |
---|
1568 | |
---|
1569 | <section title="Since draft-ietf-httpbis-p4-conditional-09" anchor="changes.since.09"> |
---|
1570 | <t> |
---|
1571 | No significant changes. |
---|
1572 | </t> |
---|
1573 | </section> |
---|
1574 | |
---|
1575 | <section title="Since draft-ietf-httpbis-p4-conditional-10" anchor="changes.since.10"> |
---|
1576 | <t> |
---|
1577 | Closed issues: |
---|
1578 | <list style="symbols"> |
---|
1579 | <t> |
---|
1580 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/69"/>: |
---|
1581 | "Clarify 'Requested Variant'" |
---|
1582 | </t> |
---|
1583 | <t> |
---|
1584 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/109"/>: |
---|
1585 | "Clarify entity / representation / variant terminology" |
---|
1586 | </t> |
---|
1587 | <t> |
---|
1588 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/220"/>: |
---|
1589 | "consider removing the 'changes from 2068' sections" |
---|
1590 | </t> |
---|
1591 | </list> |
---|
1592 | </t> |
---|
1593 | </section> |
---|
1594 | |
---|
1595 | <section title="Since draft-ietf-httpbis-p4-conditional-11" anchor="changes.since.11"> |
---|
1596 | <t> |
---|
1597 | None. |
---|
1598 | </t> |
---|
1599 | </section> |
---|
1600 | |
---|
1601 | <section title="Since draft-ietf-httpbis-p4-conditional-12" anchor="changes.since.12"> |
---|
1602 | <t> |
---|
1603 | Closed issues: |
---|
1604 | <list style="symbols"> |
---|
1605 | <t> |
---|
1606 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/224"/>: |
---|
1607 | "Header Classification" |
---|
1608 | </t> |
---|
1609 | </list> |
---|
1610 | </t> |
---|
1611 | </section> |
---|
1612 | |
---|
1613 | <section title="Since draft-ietf-httpbis-p4-conditional-13" anchor="changes.since.13"> |
---|
1614 | <t> |
---|
1615 | Closed issues: |
---|
1616 | <list style="symbols"> |
---|
1617 | <t> |
---|
1618 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/89"/>: |
---|
1619 | "If-* and entities" |
---|
1620 | </t> |
---|
1621 | <t> |
---|
1622 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/101"/>: |
---|
1623 | "Definition of validator weakness" |
---|
1624 | </t> |
---|
1625 | <t> |
---|
1626 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/276"/>: |
---|
1627 | "untangle ABNFs for header fields" |
---|
1628 | </t> |
---|
1629 | <t> |
---|
1630 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/269"/>: |
---|
1631 | "ETags and Quotes" |
---|
1632 | </t> |
---|
1633 | </list> |
---|
1634 | </t> |
---|
1635 | </section> |
---|
1636 | |
---|
1637 | <section title="Since draft-ietf-httpbis-p4-conditional-14" anchor="changes.since.14"> |
---|
1638 | <t> |
---|
1639 | None. |
---|
1640 | </t> |
---|
1641 | </section> |
---|
1642 | |
---|
1643 | <section title="Since draft-ietf-httpbis-p4-conditional-15" anchor="changes.since.15"> |
---|
1644 | <t> |
---|
1645 | Closed issues: |
---|
1646 | <list style="symbols"> |
---|
1647 | <t> |
---|
1648 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/304"/>: |
---|
1649 | "If-Range should be listed when dicussing contexts where L-M can be considered strong" |
---|
1650 | </t> |
---|
1651 | </list> |
---|
1652 | </t> |
---|
1653 | </section> |
---|
1654 | |
---|
1655 | <section title="Since draft-ietf-httpbis-p4-conditional-16" anchor="changes.since.16"> |
---|
1656 | <t> |
---|
1657 | Closed issues: |
---|
1658 | <list style="symbols"> |
---|
1659 | <t> |
---|
1660 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/186"/>: |
---|
1661 | "Document HTTP's error-handling philosophy" |
---|
1662 | </t> |
---|
1663 | </list> |
---|
1664 | </t> |
---|
1665 | </section> |
---|
1666 | |
---|
1667 | <section title="Since draft-ietf-httpbis-p4-conditional-17" anchor="changes.since.17"> |
---|
1668 | <t> |
---|
1669 | Closed issues: |
---|
1670 | <list style="symbols"> |
---|
1671 | <t> |
---|
1672 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/306"/>: |
---|
1673 | "does etag value really use quoted-string" |
---|
1674 | </t> |
---|
1675 | </list> |
---|
1676 | </t> |
---|
1677 | </section> |
---|
1678 | |
---|
1679 | <section title="Since draft-ietf-httpbis-p4-conditional-18" anchor="changes.since.18"> |
---|
1680 | <t> |
---|
1681 | Closed issues: |
---|
1682 | <list style="symbols"> |
---|
1683 | <t> |
---|
1684 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/345"/>: |
---|
1685 | "Required headers on 304 and 206" |
---|
1686 | </t> |
---|
1687 | </list> |
---|
1688 | </t> |
---|
1689 | </section> |
---|
1690 | |
---|
1691 | </section> |
---|
1692 | |
---|
1693 | </back> |
---|
1694 | </rfc> |
---|