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 "latest"> |
---|
15 | <!ENTITY ID-MONTH "July"> |
---|
16 | <!ENTITY ID-YEAR "2010"> |
---|
17 | <!ENTITY notation "<xref target='Part1' x:rel='#notation' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
18 | <!ENTITY notation-abnf "<xref target='Part1' x:rel='#notation.abnf' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
19 | <!ENTITY basic-rules "<xref target='Part1' x:rel='#basic.rules' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
20 | <!ENTITY full-date "<xref target='Part1' x:rel='#date.time.formats.full.date' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
21 | <!ENTITY messaging "<xref target='Part1' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
22 | <!ENTITY entity-tags "<xref target='Part4' x:rel='#entity.tags' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
23 | <!ENTITY weak-and-strong-validators "<xref target='Part4' x:rel='#weak.and.strong.validators' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
24 | ]> |
---|
25 | <?rfc toc="yes" ?> |
---|
26 | <?rfc symrefs="yes" ?> |
---|
27 | <?rfc sortrefs="yes" ?> |
---|
28 | <?rfc compact="yes"?> |
---|
29 | <?rfc subcompact="no" ?> |
---|
30 | <?rfc linkmailto="no" ?> |
---|
31 | <?rfc editing="no" ?> |
---|
32 | <?rfc comments="yes"?> |
---|
33 | <?rfc inline="yes"?> |
---|
34 | <?rfc rfcedstyle="yes"?> |
---|
35 | <?rfc-ext allow-markup-in-artwork="yes" ?> |
---|
36 | <?rfc-ext include-references-in-index="yes" ?> |
---|
37 | <rfc obsoletes="2616" category="std" x:maturity-level="draft" |
---|
38 | ipr="pre5378Trust200902" docName="draft-ietf-httpbis-p5-range-&ID-VERSION;" xmlns:x='http://purl.org/net/xml2rfc/ext'> |
---|
39 | <front> |
---|
40 | |
---|
41 | <title abbrev="HTTP/1.1, Part 5">HTTP/1.1, part 5: Range Requests and Partial Responses</title> |
---|
42 | |
---|
43 | <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor"> |
---|
44 | <organization abbrev="Day Software">Day Software</organization> |
---|
45 | <address> |
---|
46 | <postal> |
---|
47 | <street>23 Corporate Plaza DR, Suite 280</street> |
---|
48 | <city>Newport Beach</city> |
---|
49 | <region>CA</region> |
---|
50 | <code>92660</code> |
---|
51 | <country>USA</country> |
---|
52 | </postal> |
---|
53 | <phone>+1-949-706-5300</phone> |
---|
54 | <facsimile>+1-949-706-5305</facsimile> |
---|
55 | <email>fielding@gbiv.com</email> |
---|
56 | <uri>http://roy.gbiv.com/</uri> |
---|
57 | </address> |
---|
58 | </author> |
---|
59 | |
---|
60 | <author initials="J." surname="Gettys" fullname="Jim Gettys"> |
---|
61 | <organization abbrev="Alcatel-Lucent">Alcatel-Lucent Bell Labs</organization> |
---|
62 | <address> |
---|
63 | <postal> |
---|
64 | <street>21 Oak Knoll Road</street> |
---|
65 | <city>Carlisle</city> |
---|
66 | <region>MA</region> |
---|
67 | <code>01741</code> |
---|
68 | <country>USA</country> |
---|
69 | </postal> |
---|
70 | <email>jg@freedesktop.org</email> |
---|
71 | <uri>http://gettys.wordpress.com/</uri> |
---|
72 | </address> |
---|
73 | </author> |
---|
74 | |
---|
75 | <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul"> |
---|
76 | <organization abbrev="HP">Hewlett-Packard Company</organization> |
---|
77 | <address> |
---|
78 | <postal> |
---|
79 | <street>HP Labs, Large Scale Systems Group</street> |
---|
80 | <street>1501 Page Mill Road, MS 1177</street> |
---|
81 | <city>Palo Alto</city> |
---|
82 | <region>CA</region> |
---|
83 | <code>94304</code> |
---|
84 | <country>USA</country> |
---|
85 | </postal> |
---|
86 | <email>JeffMogul@acm.org</email> |
---|
87 | </address> |
---|
88 | </author> |
---|
89 | |
---|
90 | <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen"> |
---|
91 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
92 | <address> |
---|
93 | <postal> |
---|
94 | <street>1 Microsoft Way</street> |
---|
95 | <city>Redmond</city> |
---|
96 | <region>WA</region> |
---|
97 | <code>98052</code> |
---|
98 | <country>USA</country> |
---|
99 | </postal> |
---|
100 | <email>henrikn@microsoft.com</email> |
---|
101 | </address> |
---|
102 | </author> |
---|
103 | |
---|
104 | <author initials="L." surname="Masinter" fullname="Larry Masinter"> |
---|
105 | <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization> |
---|
106 | <address> |
---|
107 | <postal> |
---|
108 | <street>345 Park Ave</street> |
---|
109 | <city>San Jose</city> |
---|
110 | <region>CA</region> |
---|
111 | <code>95110</code> |
---|
112 | <country>USA</country> |
---|
113 | </postal> |
---|
114 | <email>LMM@acm.org</email> |
---|
115 | <uri>http://larry.masinter.net/</uri> |
---|
116 | </address> |
---|
117 | </author> |
---|
118 | |
---|
119 | <author initials="P." surname="Leach" fullname="Paul J. Leach"> |
---|
120 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
121 | <address> |
---|
122 | <postal> |
---|
123 | <street>1 Microsoft Way</street> |
---|
124 | <city>Redmond</city> |
---|
125 | <region>WA</region> |
---|
126 | <code>98052</code> |
---|
127 | </postal> |
---|
128 | <email>paulle@microsoft.com</email> |
---|
129 | </address> |
---|
130 | </author> |
---|
131 | |
---|
132 | <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee"> |
---|
133 | <organization abbrev="W3C/MIT">World Wide Web Consortium</organization> |
---|
134 | <address> |
---|
135 | <postal> |
---|
136 | <street>MIT Computer Science and Artificial Intelligence Laboratory</street> |
---|
137 | <street>The Stata Center, Building 32</street> |
---|
138 | <street>32 Vassar Street</street> |
---|
139 | <city>Cambridge</city> |
---|
140 | <region>MA</region> |
---|
141 | <code>02139</code> |
---|
142 | <country>USA</country> |
---|
143 | </postal> |
---|
144 | <email>timbl@w3.org</email> |
---|
145 | <uri>http://www.w3.org/People/Berners-Lee/</uri> |
---|
146 | </address> |
---|
147 | </author> |
---|
148 | |
---|
149 | <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor"> |
---|
150 | <organization abbrev="W3C">World Wide Web Consortium</organization> |
---|
151 | <address> |
---|
152 | <postal> |
---|
153 | <street>W3C / ERCIM</street> |
---|
154 | <street>2004, rte des Lucioles</street> |
---|
155 | <city>Sophia-Antipolis</city> |
---|
156 | <region>AM</region> |
---|
157 | <code>06902</code> |
---|
158 | <country>France</country> |
---|
159 | </postal> |
---|
160 | <email>ylafon@w3.org</email> |
---|
161 | <uri>http://www.raubacapeu.net/people/yves/</uri> |
---|
162 | </address> |
---|
163 | </author> |
---|
164 | |
---|
165 | <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor"> |
---|
166 | <organization abbrev="greenbytes">greenbytes GmbH</organization> |
---|
167 | <address> |
---|
168 | <postal> |
---|
169 | <street>Hafenweg 16</street> |
---|
170 | <city>Muenster</city><region>NW</region><code>48155</code> |
---|
171 | <country>Germany</country> |
---|
172 | </postal> |
---|
173 | <phone>+49 251 2807760</phone> |
---|
174 | <facsimile>+49 251 2807761</facsimile> |
---|
175 | <email>julian.reschke@greenbytes.de</email> |
---|
176 | <uri>http://greenbytes.de/tech/webdav/</uri> |
---|
177 | </address> |
---|
178 | </author> |
---|
179 | |
---|
180 | <date month="&ID-MONTH;" year="&ID-YEAR;"/> |
---|
181 | <workgroup>HTTPbis Working Group</workgroup> |
---|
182 | |
---|
183 | <abstract> |
---|
184 | <t> |
---|
185 | The Hypertext Transfer Protocol (HTTP) is an application-level |
---|
186 | protocol for distributed, collaborative, hypermedia information |
---|
187 | systems. HTTP has been in use by the World Wide Web global information |
---|
188 | initiative since 1990. This document is Part 5 of the seven-part specification |
---|
189 | that defines the protocol referred to as "HTTP/1.1" and, taken together, |
---|
190 | obsoletes RFC 2616. Part 5 defines range-specific requests and |
---|
191 | the rules for constructing and combining responses to those requests. |
---|
192 | </t> |
---|
193 | </abstract> |
---|
194 | |
---|
195 | <note title="Editorial Note (To be removed by RFC Editor)"> |
---|
196 | <t> |
---|
197 | Discussion of this draft should take place on the HTTPBIS working group |
---|
198 | mailing list (ietf-http-wg@w3.org). The current issues list is |
---|
199 | at <eref target="http://tools.ietf.org/wg/httpbis/trac/report/3"/> |
---|
200 | and related documents (including fancy diffs) can be found at |
---|
201 | <eref target="http://tools.ietf.org/wg/httpbis/"/>. |
---|
202 | </t> |
---|
203 | <t> |
---|
204 | The changes in this draft are summarized in <xref target="changes.since.10"/>. |
---|
205 | </t> |
---|
206 | </note> |
---|
207 | </front> |
---|
208 | <middle> |
---|
209 | <section title="Introduction" anchor="introduction"> |
---|
210 | <t> |
---|
211 | HTTP clients often encounter interrupted data transfers as a result |
---|
212 | of cancelled requests or dropped connections. When a cache has stored |
---|
213 | a partial representation, it is desirable to request the remainder |
---|
214 | of that representation in a subsequent request rather than transfer |
---|
215 | the entire representation. |
---|
216 | There are also a number of Web applications that benefit from being |
---|
217 | able to request only a subset of a larger representation, such as a |
---|
218 | single page of a very large document or only part of an image to be |
---|
219 | rendered by a device with limited local storage. |
---|
220 | </t> |
---|
221 | <t> |
---|
222 | This document defines HTTP/1.1 range requests, |
---|
223 | partial responses, and the multipart/byteranges media type. |
---|
224 | The protocol for range requests is an &OPTIONAL; feature of HTTP, |
---|
225 | designed so resources or recipients that do not implement this feature |
---|
226 | can respond as if it is a normal GET request without impacting |
---|
227 | interoperability. Partial responses are indicated by a distinct status |
---|
228 | code to not be mistaken for full responses by intermediate caches |
---|
229 | that might not implement the feature. |
---|
230 | </t> |
---|
231 | <t> |
---|
232 | Although the HTTP range request mechanism is designed to allow for |
---|
233 | extensible range types, this specification only defines requests for |
---|
234 | byte ranges. |
---|
235 | </t> |
---|
236 | |
---|
237 | <section title="Requirements" anchor="intro.requirements"> |
---|
238 | <t> |
---|
239 | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", |
---|
240 | "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this |
---|
241 | document are to be interpreted as described in <xref target="RFC2119"/>. |
---|
242 | </t> |
---|
243 | <t> |
---|
244 | An implementation is not compliant if it fails to satisfy one or more |
---|
245 | of the "MUST" or "REQUIRED" level requirements for the protocols it |
---|
246 | implements. An implementation that satisfies all the "MUST" or "REQUIRED" |
---|
247 | level and all the "SHOULD" level requirements for its protocols is said |
---|
248 | to be "unconditionally compliant"; one that satisfies all the "MUST" |
---|
249 | level requirements but not all the "SHOULD" level requirements for its |
---|
250 | protocols is said to be "conditionally compliant". |
---|
251 | </t> |
---|
252 | </section> |
---|
253 | |
---|
254 | <section title="Syntax Notation" anchor="notation"> |
---|
255 | <x:anchor-alias value="ALPHA"/> |
---|
256 | <x:anchor-alias value="CHAR"/> |
---|
257 | <x:anchor-alias value="CR"/> |
---|
258 | <x:anchor-alias value="DIGIT"/> |
---|
259 | <x:anchor-alias value="LF"/> |
---|
260 | <x:anchor-alias value="OCTET"/> |
---|
261 | <x:anchor-alias value="SP"/> |
---|
262 | <x:anchor-alias value="VCHAR"/> |
---|
263 | <x:anchor-alias value="WSP"/> |
---|
264 | <t> |
---|
265 | This specification uses the ABNF syntax defined in ¬ation; (which |
---|
266 | extends the syntax defined in <xref target="RFC5234"/> with a list rule). |
---|
267 | <xref target="collected.abnf"/> shows the collected ABNF, with the list |
---|
268 | rule expanded. |
---|
269 | </t> |
---|
270 | <t> |
---|
271 | The following core rules are included by |
---|
272 | reference, as defined in <xref target="RFC5234" x:fmt="," x:sec="B.1"/>: |
---|
273 | ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls), |
---|
274 | DIGIT (decimal 0-9), DQUOTE (double quote), |
---|
275 | HEXDIG (hexadecimal 0-9/A-F/a-f), LF (line feed), |
---|
276 | OCTET (any 8-bit sequence of data), SP (space), |
---|
277 | VCHAR (any visible USASCII character), |
---|
278 | and WSP (whitespace). |
---|
279 | </t> |
---|
280 | |
---|
281 | <section title="Core Rules" anchor="core.rules"> |
---|
282 | <x:anchor-alias value="token"/> |
---|
283 | <x:anchor-alias value="OWS"/> |
---|
284 | <t> |
---|
285 | The core rules below are defined in &basic-rules;: |
---|
286 | </t> |
---|
287 | <figure><artwork type="abnf2616"> |
---|
288 | <x:ref>token</x:ref> = <token, defined in &basic-rules;> |
---|
289 | <x:ref>OWS</x:ref> = <OWS, defined in &basic-rules;> |
---|
290 | </artwork></figure> |
---|
291 | </section> |
---|
292 | |
---|
293 | <section title="ABNF Rules defined in other Parts of the Specification" anchor="abnf.dependencies"> |
---|
294 | <x:anchor-alias value="entity-tag"/> |
---|
295 | <x:anchor-alias value="HTTP-date"/> |
---|
296 | <t> |
---|
297 | The ABNF rules below are defined in other parts: |
---|
298 | </t> |
---|
299 | <figure><!--Part1--><artwork type="abnf2616"> |
---|
300 | <x:ref>HTTP-date</x:ref> = <HTTP-date, defined in &full-date;> |
---|
301 | </artwork></figure> |
---|
302 | <figure><!--Part4--><artwork type="abnf2616"> |
---|
303 | <x:ref>entity-tag</x:ref> = <entity-tag, defined in &entity-tags;> |
---|
304 | </artwork></figure> |
---|
305 | </section> |
---|
306 | |
---|
307 | </section> |
---|
308 | |
---|
309 | </section> |
---|
310 | |
---|
311 | |
---|
312 | <section title="Range Units" anchor="range.units"> |
---|
313 | <x:anchor-alias value="bytes-unit"/> |
---|
314 | <x:anchor-alias value="other-range-unit"/> |
---|
315 | <x:anchor-alias value="range-unit"/> |
---|
316 | <t> |
---|
317 | HTTP/1.1 allows a client to request that only part (a range of) the |
---|
318 | response entity be included within the response. HTTP/1.1 uses range |
---|
319 | units in the Range (<xref target="header.range"/>) and Content-Range (<xref target="header.content-range"/>) |
---|
320 | header fields. An entity can be broken down into subranges according |
---|
321 | to various structural units. |
---|
322 | </t> |
---|
323 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="range-unit"/><iref primary="true" item="Grammar" subitem="bytes-unit"/><iref primary="true" item="Grammar" subitem="other-range-unit"/> |
---|
324 | <x:ref>range-unit</x:ref> = <x:ref>bytes-unit</x:ref> / <x:ref>other-range-unit</x:ref> |
---|
325 | <x:ref>bytes-unit</x:ref> = "bytes" |
---|
326 | <x:ref>other-range-unit</x:ref> = <x:ref>token</x:ref> |
---|
327 | </artwork></figure> |
---|
328 | <t> |
---|
329 | HTTP/1.1 has been designed to allow implementations of applications |
---|
330 | that do not depend on knowledge of ranges. The only range unit defined |
---|
331 | by HTTP/1.1 is "bytes". |
---|
332 | </t> |
---|
333 | <t> |
---|
334 | If a range unit is not understood in a request, a server &MUST; ignore |
---|
335 | the whole Range header (<xref target="header.range" />). |
---|
336 | If a range unit is not understood in a response, an intermediary |
---|
337 | &SHOULD; pass the response to the client; a client &MUST; fail. |
---|
338 | </t> |
---|
339 | </section> |
---|
340 | |
---|
341 | <section title="Status Code Definitions" anchor="status.code.definitions"> |
---|
342 | <section title="206 Partial Content" anchor="status.206"> |
---|
343 | <iref primary="true" item="206 Partial Content (status code)" x:for-anchor=""/> |
---|
344 | <iref primary="true" item="Status Codes" subitem="206 Partial Content" x:for-anchor=""/> |
---|
345 | <t> |
---|
346 | The server has fulfilled the partial GET request for the resource. |
---|
347 | The request &MUST; have included a Range header field (<xref target="header.range"/>) |
---|
348 | indicating the desired range, and &MAY; have included an If-Range |
---|
349 | header field (<xref target="header.if-range"/>) to make the request conditional. |
---|
350 | </t> |
---|
351 | <t> |
---|
352 | The response &MUST; include the following header fields: |
---|
353 | <list style="symbols"> |
---|
354 | <t> |
---|
355 | Either a Content-Range header field (<xref target="header.content-range"/>) indicating |
---|
356 | the range included with this response, or a multipart/byteranges |
---|
357 | Content-Type including Content-Range fields for each part. If a |
---|
358 | Content-Length header field is present in the response, its |
---|
359 | value &MUST; match the actual number of octets transmitted in the |
---|
360 | message-body. |
---|
361 | </t> |
---|
362 | <t> |
---|
363 | Date |
---|
364 | </t> |
---|
365 | <t> |
---|
366 | Cache-Control, ETag, Expires, Content-Location, Last-Modified, |
---|
367 | and/or Vary, if the header field would have been sent in a 200 |
---|
368 | response to the same request |
---|
369 | </t> |
---|
370 | </list> |
---|
371 | </t> |
---|
372 | <t> |
---|
373 | If the 206 response is the result of an If-Range request, the response |
---|
374 | &SHOULD-NOT; include other entity-headers. Otherwise, the response |
---|
375 | &MUST; include all of the entity-headers that would have been returned |
---|
376 | with a 200 (OK) response to the same request. |
---|
377 | </t> |
---|
378 | <t> |
---|
379 | A cache &MUST-NOT; combine a 206 response with other previously cached |
---|
380 | content if the ETag or Last-Modified headers do not match exactly, |
---|
381 | see <xref target="combining.byte.ranges"/>. |
---|
382 | </t> |
---|
383 | <t> |
---|
384 | A cache that does not support the Range and Content-Range headers |
---|
385 | &MUST-NOT; cache 206 (Partial Content) responses. Furthermore, |
---|
386 | if a response uses a range unit that is not understood by the cache, |
---|
387 | then it &MUST-NOT; be cached either. |
---|
388 | </t> |
---|
389 | </section> |
---|
390 | |
---|
391 | <section title="416 Requested Range Not Satisfiable" anchor="status.416"> |
---|
392 | <iref primary="true" item="416 Requested Range Not Satisfiable (status code)" x:for-anchor=""/> |
---|
393 | <iref primary="true" item="Status Codes" subitem="416 Requested Range Not Satisfiable" x:for-anchor=""/> |
---|
394 | <t> |
---|
395 | A server &SHOULD; return a response with this status code if a request |
---|
396 | included a Range request-header field (<xref target="header.range"/>), and none of |
---|
397 | the ranges-specifier values in this field overlap the current extent |
---|
398 | of the selected resource, and the request did not include an If-Range |
---|
399 | request-header field (<xref target="header.if-range"/>). (For byte-ranges, |
---|
400 | this means that the first-byte-pos of all of the byte-range-spec values were |
---|
401 | greater than the current length of the selected resource.) |
---|
402 | </t> |
---|
403 | <t> |
---|
404 | When this status code is returned for a byte-range request, the |
---|
405 | response &SHOULD; include a Content-Range entity-header field |
---|
406 | specifying the current length of the selected resource (see <xref target="header.content-range"/>). |
---|
407 | This response &MUST-NOT; use the multipart/byteranges content-type. |
---|
408 | </t> |
---|
409 | </section> |
---|
410 | </section> |
---|
411 | |
---|
412 | <section title="Combining Ranges" anchor="combining.byte.ranges"> |
---|
413 | <t> |
---|
414 | A response might transfer only a subrange of an entity-body, either because |
---|
415 | the request included one or more Range specifications, or because |
---|
416 | a connection was broken prematurely. |
---|
417 | After several such transfers, a cache might have received several |
---|
418 | ranges of the same entity-body. |
---|
419 | </t> |
---|
420 | <t> |
---|
421 | If a cache has a stored non-empty set of subranges for an entity, and |
---|
422 | an incoming response transfers another subrange, the cache &MAY; |
---|
423 | combine the new subrange with the existing set if both the following |
---|
424 | conditions are met: |
---|
425 | <list style="symbols"> |
---|
426 | <t>Both the incoming response and the cache entry have a cache |
---|
427 | validator.</t> |
---|
428 | <t>The two cache validators match using the strong comparison |
---|
429 | function (see &weak-and-strong-validators;).</t> |
---|
430 | </list> |
---|
431 | </t> |
---|
432 | <t> |
---|
433 | If either requirement is not met, the cache &MUST; use only the most |
---|
434 | recent partial response (based on the Date values transmitted with |
---|
435 | every response, and using the incoming response if these values are |
---|
436 | equal or missing), and &MUST; discard the other partial information. |
---|
437 | </t> |
---|
438 | </section> |
---|
439 | |
---|
440 | <section title="Header Field Definitions" anchor="header.fields"> |
---|
441 | <t> |
---|
442 | This section defines the syntax and semantics of HTTP/1.1 header fields |
---|
443 | related to range requests and partial responses. |
---|
444 | </t> |
---|
445 | <t> |
---|
446 | For entity-header fields, both sender and recipient refer to either the |
---|
447 | client or the server, depending on who sends and who receives the entity. |
---|
448 | </t> |
---|
449 | |
---|
450 | <section title="Accept-Ranges" anchor="header.accept-ranges"> |
---|
451 | <iref primary="true" item="Accept-Ranges header" x:for-anchor=""/> |
---|
452 | <iref primary="true" item="Headers" subitem="Accept-Ranges" x:for-anchor=""/> |
---|
453 | <x:anchor-alias value="Accept-Ranges"/> |
---|
454 | <x:anchor-alias value="Accept-Ranges-v"/> |
---|
455 | <x:anchor-alias value="acceptable-ranges"/> |
---|
456 | <t> |
---|
457 | The "Accept-Ranges" response-header field allows a resource to indicate |
---|
458 | its acceptance of range requests. |
---|
459 | </t> |
---|
460 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Ranges"/><iref primary="true" item="Grammar" subitem="Accept-Ranges-v"/><iref primary="true" item="Grammar" subitem="acceptable-ranges"/> |
---|
461 | <x:ref>Accept-Ranges</x:ref> = "Accept-Ranges" ":" <x:ref>OWS</x:ref> <x:ref>Accept-Ranges-v</x:ref> |
---|
462 | <x:ref>Accept-Ranges-v</x:ref> = <x:ref>acceptable-ranges</x:ref> |
---|
463 | <x:ref>acceptable-ranges</x:ref> = 1#<x:ref>range-unit</x:ref> / "none" |
---|
464 | </artwork></figure> |
---|
465 | <t> |
---|
466 | Origin servers that accept byte-range requests &MAY; send |
---|
467 | </t> |
---|
468 | <figure><artwork type="example"> |
---|
469 | Accept-Ranges: bytes |
---|
470 | </artwork></figure> |
---|
471 | <t> |
---|
472 | but are not required to do so. Clients &MAY; generate range |
---|
473 | requests without having received this header for the resource |
---|
474 | involved. Range units are defined in <xref target="range.units"/>. |
---|
475 | </t> |
---|
476 | <t> |
---|
477 | Servers that do not accept any kind of range request for a |
---|
478 | resource &MAY; send |
---|
479 | </t> |
---|
480 | <figure><artwork type="example"> |
---|
481 | Accept-Ranges: none |
---|
482 | </artwork></figure> |
---|
483 | <t> |
---|
484 | to advise the client not to attempt a range request. |
---|
485 | </t> |
---|
486 | </section> |
---|
487 | |
---|
488 | <section title="Content-Range" anchor="header.content-range"> |
---|
489 | <iref primary="true" item="Content-Range header" x:for-anchor=""/> |
---|
490 | <iref primary="true" item="Headers" subitem="Content-Range" x:for-anchor=""/> |
---|
491 | <x:anchor-alias value="byte-content-range-spec"/> |
---|
492 | <x:anchor-alias value="byte-range-resp-spec"/> |
---|
493 | <x:anchor-alias value="Content-Range"/> |
---|
494 | <x:anchor-alias value="Content-Range-v"/> |
---|
495 | <x:anchor-alias value="content-range-spec"/> |
---|
496 | <x:anchor-alias value="instance-length"/> |
---|
497 | <x:anchor-alias value="other-content-range-spec"/> |
---|
498 | <x:anchor-alias value="other-range-resp-spec"/> |
---|
499 | <t> |
---|
500 | The "Content-Range" entity-header field is sent with a partial entity-body to |
---|
501 | specify where in the full entity-body the partial body should be |
---|
502 | applied. Range units are defined in <xref target="range.units"/>. |
---|
503 | </t> |
---|
504 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Range"/><iref primary="true" item="Grammar" subitem="Content-Range-v"/><iref primary="true" item="Grammar" subitem="content-range-spec"/><iref primary="true" item="Grammar" subitem="byte-content-range-spec"/><iref primary="true" item="Grammar" subitem="byte-range-resp-spec"/><iref primary="true" item="Grammar" subitem="instance-length"/> |
---|
505 | <x:ref>Content-Range</x:ref> = "Content-Range" ":" <x:ref>OWS</x:ref> <x:ref>Content-Range-v</x:ref> |
---|
506 | <x:ref>Content-Range-v</x:ref> = <x:ref>content-range-spec</x:ref> |
---|
507 | |
---|
508 | <x:ref>content-range-spec</x:ref> = <x:ref>byte-content-range-spec</x:ref> |
---|
509 | / <x:ref>other-content-range-spec</x:ref> |
---|
510 | <x:ref>byte-content-range-spec</x:ref> = <x:ref>bytes-unit</x:ref> <x:ref>SP</x:ref> |
---|
511 | <x:ref>byte-range-resp-spec</x:ref> "/" |
---|
512 | ( <x:ref>instance-length</x:ref> / "*" ) |
---|
513 | |
---|
514 | <x:ref>byte-range-resp-spec</x:ref> = (<x:ref>first-byte-pos</x:ref> "-" <x:ref>last-byte-pos</x:ref>) |
---|
515 | / "*" |
---|
516 | |
---|
517 | <x:ref>instance-length</x:ref> = 1*<x:ref>DIGIT</x:ref> |
---|
518 | |
---|
519 | <x:ref>other-content-range-spec</x:ref> = <x:ref>other-range-unit</x:ref> <x:ref>SP</x:ref> |
---|
520 | <x:ref>other-range-resp-spec</x:ref> |
---|
521 | <x:ref>other-range-resp-spec</x:ref> = *<x:ref>CHAR</x:ref> |
---|
522 | </artwork></figure> |
---|
523 | <t> |
---|
524 | The header &SHOULD; indicate the total length of the full entity-body, |
---|
525 | unless this length is unknown or difficult to determine. The asterisk |
---|
526 | "*" character means that the instance-length is unknown at the time |
---|
527 | when the response was generated. |
---|
528 | </t> |
---|
529 | <t> |
---|
530 | Unlike byte-ranges-specifier values (see <xref target="byte.ranges"/>), a byte-range-resp-spec |
---|
531 | &MUST; only specify one range, and &MUST; contain |
---|
532 | absolute byte positions for both the first and last byte of the |
---|
533 | range. |
---|
534 | </t> |
---|
535 | <t> |
---|
536 | A byte-content-range-spec with a byte-range-resp-spec whose last-byte-pos |
---|
537 | value is less than its first-byte-pos value, or whose |
---|
538 | instance-length value is less than or equal to its last-byte-pos |
---|
539 | value, is invalid. The recipient of an invalid byte-content-range-spec |
---|
540 | &MUST; ignore it and any content transferred along with it. |
---|
541 | </t> |
---|
542 | <t> |
---|
543 | In the case of a byte range request: |
---|
544 | A server sending a response with status code 416 (Requested range not |
---|
545 | satisfiable) &SHOULD; include a Content-Range field with a byte-range-resp-spec |
---|
546 | of "*". The instance-length specifies the current length of |
---|
547 | the selected resource. A response with status code 206 (Partial |
---|
548 | Content) &MUST-NOT; include a Content-Range field with a byte-range-resp-spec of "*". |
---|
549 | </t> |
---|
550 | <t> |
---|
551 | Examples of byte-content-range-spec values, assuming that the entity |
---|
552 | contains a total of 1234 bytes: |
---|
553 | <list style="symbols"> |
---|
554 | <t> |
---|
555 | The first 500 bytes: |
---|
556 | <figure><artwork type="example" x:indent-with=" "> |
---|
557 | bytes 0-499/1234 |
---|
558 | </artwork></figure> |
---|
559 | </t> |
---|
560 | <t> |
---|
561 | The second 500 bytes: |
---|
562 | <figure><artwork type="example" x:indent-with=" "> |
---|
563 | bytes 500-999/1234 |
---|
564 | </artwork></figure> |
---|
565 | </t> |
---|
566 | <t> |
---|
567 | All except for the first 500 bytes: |
---|
568 | <figure><artwork type="example" x:indent-with=" "> |
---|
569 | bytes 500-1233/1234 |
---|
570 | </artwork></figure> |
---|
571 | </t> |
---|
572 | <t> |
---|
573 | The last 500 bytes: |
---|
574 | <figure><artwork type="example" x:indent-with=" "> |
---|
575 | bytes 734-1233/1234 |
---|
576 | </artwork></figure> |
---|
577 | </t> |
---|
578 | </list> |
---|
579 | </t> |
---|
580 | <t> |
---|
581 | When an HTTP message includes the content of a single range (for |
---|
582 | example, a response to a request for a single range, or to a request |
---|
583 | for a set of ranges that overlap without any holes), this content is |
---|
584 | transmitted with a Content-Range header, and a Content-Length header |
---|
585 | showing the number of bytes actually transferred. For example, |
---|
586 | </t> |
---|
587 | <figure><artwork type="example"> |
---|
588 | HTTP/1.1 206 Partial Content |
---|
589 | Date: Wed, 15 Nov 1995 06:25:24 GMT |
---|
590 | Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT |
---|
591 | Content-Range: bytes 21010-47021/47022 |
---|
592 | Content-Length: 26012 |
---|
593 | Content-Type: image/gif |
---|
594 | </artwork></figure> |
---|
595 | <t> |
---|
596 | When an HTTP message includes the content of multiple ranges (for |
---|
597 | example, a response to a request for multiple non-overlapping |
---|
598 | ranges), these are transmitted as a multipart message. The multipart |
---|
599 | media type used for this purpose is "multipart/byteranges" as defined |
---|
600 | in <xref target="internet.media.type.multipart.byteranges"/>. See <xref target="changes.from.rfc.2068"/> for a compatibility issue. |
---|
601 | </t> |
---|
602 | <t> |
---|
603 | A response to a request for a single range &MUST-NOT; be sent using the |
---|
604 | multipart/byteranges media type. A response to a request for |
---|
605 | multiple ranges, whose result is a single range, &MAY; be sent as a |
---|
606 | multipart/byteranges media type with one part. A client that cannot |
---|
607 | decode a multipart/byteranges message &MUST-NOT; ask for multiple |
---|
608 | ranges in a single request. |
---|
609 | </t> |
---|
610 | <t> |
---|
611 | When a client requests multiple ranges in one request, the |
---|
612 | server &SHOULD; return them in the order that they appeared in the |
---|
613 | request. |
---|
614 | </t> |
---|
615 | <t> |
---|
616 | If the server ignores a byte-range-spec because it is syntactically |
---|
617 | invalid, the server &SHOULD; treat the request as if the invalid Range |
---|
618 | header field did not exist. (Normally, this means return a 200 |
---|
619 | response containing the full entity). |
---|
620 | </t> |
---|
621 | <t> |
---|
622 | If the server receives a request (other than one including an If-Range |
---|
623 | request-header field) with an unsatisfiable Range request-header |
---|
624 | field (that is, all of whose byte-range-spec values have a |
---|
625 | first-byte-pos value greater than the current length of the selected |
---|
626 | resource), it &SHOULD; return a response code of 416 (Requested range |
---|
627 | not satisfiable) (<xref target="status.416"/>). |
---|
628 | </t> |
---|
629 | <x:note> |
---|
630 | <t> |
---|
631 | <x:h>Note:</x:h> Clients cannot depend on servers to send a 416 (Requested |
---|
632 | range not satisfiable) response instead of a 200 (OK) response for |
---|
633 | an unsatisfiable Range request-header, since not all servers |
---|
634 | implement this request-header. |
---|
635 | </t> |
---|
636 | </x:note> |
---|
637 | </section> |
---|
638 | |
---|
639 | <section title="If-Range" anchor="header.if-range"> |
---|
640 | <iref primary="true" item="If-Range header" x:for-anchor=""/> |
---|
641 | <iref primary="true" item="Headers" subitem="If-Range" x:for-anchor=""/> |
---|
642 | <x:anchor-alias value="If-Range"/> |
---|
643 | <x:anchor-alias value="If-Range-v"/> |
---|
644 | <t> |
---|
645 | If a client has a partial copy of an entity in its cache, and wishes |
---|
646 | to have an up-to-date copy of the entire entity in its cache, it |
---|
647 | could use the Range request-header with a conditional GET (using |
---|
648 | either or both of If-Unmodified-Since and If-Match.) However, if the |
---|
649 | condition fails because the entity has been modified, the client |
---|
650 | would then have to make a second request to obtain the entire current |
---|
651 | entity-body. |
---|
652 | </t> |
---|
653 | <t> |
---|
654 | The "If-Range" request-header field allows a client to "short-circuit" the second |
---|
655 | request. Informally, its meaning is "if the entity is unchanged, send |
---|
656 | me the part(s) that I am missing; otherwise, send me the entire new |
---|
657 | entity". |
---|
658 | </t> |
---|
659 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Range"/><iref primary="true" item="Grammar" subitem="If-Range-v"/> |
---|
660 | <x:ref>If-Range</x:ref> = "If-Range" ":" <x:ref>OWS</x:ref> <x:ref>If-Range-v</x:ref> |
---|
661 | <x:ref>If-Range-v</x:ref> = <x:ref>entity-tag</x:ref> / <x:ref>HTTP-date</x:ref> |
---|
662 | </artwork></figure> |
---|
663 | <t> |
---|
664 | If the client has no entity tag for an entity, but does have a Last-Modified |
---|
665 | date, it &MAY; use that date in an If-Range header. (The |
---|
666 | server can distinguish between a valid HTTP-date and any form of |
---|
667 | entity-tag by examining no more than two characters.) The If-Range |
---|
668 | header &SHOULD; only be used together with a Range header, and &MUST; be |
---|
669 | ignored if the request does not include a Range header, or if the |
---|
670 | server does not support the sub-range operation. |
---|
671 | </t> |
---|
672 | <t> |
---|
673 | If the entity tag given in the If-Range header matches the current |
---|
674 | cache validator for the entity, then the server &SHOULD; provide the |
---|
675 | specified sub-range of the entity using a 206 (Partial Content) |
---|
676 | response. If the cache validator does not match, then the server &SHOULD; |
---|
677 | return the entire entity using a 200 (OK) response. |
---|
678 | </t> |
---|
679 | </section> |
---|
680 | |
---|
681 | <section title="Range" anchor="header.range"> |
---|
682 | <iref primary="true" item="Range header" x:for-anchor=""/> |
---|
683 | <iref primary="true" item="Headers" subitem="Range" x:for-anchor=""/> |
---|
684 | |
---|
685 | <section title="Byte Ranges" anchor="byte.ranges"> |
---|
686 | <t> |
---|
687 | Since all HTTP entities are represented in HTTP messages as sequences |
---|
688 | of bytes, the concept of a byte range is meaningful for any HTTP |
---|
689 | entity. (However, not all clients and servers need to support byte-range |
---|
690 | operations.) |
---|
691 | </t> |
---|
692 | <t> |
---|
693 | Byte range specifications in HTTP apply to the sequence of bytes in |
---|
694 | the entity-body (not necessarily the same as the message-body). |
---|
695 | </t> |
---|
696 | <t anchor="rule.ranges-specifier"> |
---|
697 | <x:anchor-alias value="byte-range-set"/> |
---|
698 | <x:anchor-alias value="byte-range-spec"/> |
---|
699 | <x:anchor-alias value="byte-ranges-specifier"/> |
---|
700 | <x:anchor-alias value="first-byte-pos"/> |
---|
701 | <x:anchor-alias value="last-byte-pos"/> |
---|
702 | <x:anchor-alias value="ranges-specifier"/> |
---|
703 | <x:anchor-alias value="suffix-byte-range-spec"/> |
---|
704 | <x:anchor-alias value="suffix-length"/> |
---|
705 | |
---|
706 | A byte range operation &MAY; specify a single range of bytes, or a set |
---|
707 | of ranges within a single entity. |
---|
708 | </t> |
---|
709 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="ranges-specifier"/><iref primary="true" item="Grammar" subitem="byte-ranges-specifier"/><iref primary="true" item="Grammar" subitem="byte-range-set"/><iref primary="true" item="Grammar" subitem="byte-range-spec"/><iref primary="true" item="Grammar" subitem="first-byte-pos"/><iref primary="true" item="Grammar" subitem="last-byte-pos"/> |
---|
710 | <x:ref>byte-ranges-specifier</x:ref> = <x:ref>bytes-unit</x:ref> "=" <x:ref>byte-range-set</x:ref> |
---|
711 | <x:ref>byte-range-set</x:ref> = 1#( <x:ref>byte-range-spec</x:ref> / <x:ref>suffix-byte-range-spec</x:ref> ) |
---|
712 | <x:ref>byte-range-spec</x:ref> = <x:ref>first-byte-pos</x:ref> "-" [ <x:ref>last-byte-pos</x:ref> ] |
---|
713 | <x:ref>first-byte-pos</x:ref> = 1*<x:ref>DIGIT</x:ref> |
---|
714 | <x:ref>last-byte-pos</x:ref> = 1*<x:ref>DIGIT</x:ref> |
---|
715 | </artwork></figure> |
---|
716 | <t> |
---|
717 | The first-byte-pos value in a byte-range-spec gives the byte-offset |
---|
718 | of the first byte in a range. The last-byte-pos value gives the |
---|
719 | byte-offset of the last byte in the range; that is, the byte |
---|
720 | positions specified are inclusive. Byte offsets start at zero. |
---|
721 | </t> |
---|
722 | <t> |
---|
723 | If the last-byte-pos value is present, it &MUST; be greater than or |
---|
724 | equal to the first-byte-pos in that byte-range-spec, or the byte-range-spec |
---|
725 | is syntactically invalid. The recipient of a byte-range-set |
---|
726 | that includes one or more syntactically invalid byte-range-spec |
---|
727 | values &MUST; ignore the header field that includes that byte-range-set. |
---|
728 | </t> |
---|
729 | <t> |
---|
730 | If the last-byte-pos value is absent, or if the value is greater than |
---|
731 | or equal to the current length of the entity-body, last-byte-pos is |
---|
732 | taken to be equal to one less than the current length of the entity-body |
---|
733 | in bytes. |
---|
734 | </t> |
---|
735 | <t> |
---|
736 | By its choice of last-byte-pos, a client can limit the number of |
---|
737 | bytes retrieved without knowing the size of the entity. |
---|
738 | </t> |
---|
739 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="suffix-byte-range-spec"/><iref primary="true" item="Grammar" subitem="suffix-length"/> |
---|
740 | <x:ref>suffix-byte-range-spec</x:ref> = "-" <x:ref>suffix-length</x:ref> |
---|
741 | <x:ref>suffix-length</x:ref> = 1*<x:ref>DIGIT</x:ref> |
---|
742 | </artwork></figure> |
---|
743 | <t> |
---|
744 | A suffix-byte-range-spec is used to specify the suffix of the |
---|
745 | entity-body, of a length given by the suffix-length value. (That is, |
---|
746 | this form specifies the last N bytes of an entity-body.) If the |
---|
747 | entity is shorter than the specified suffix-length, the entire |
---|
748 | entity-body is used. |
---|
749 | </t> |
---|
750 | <t> |
---|
751 | If a syntactically valid byte-range-set includes at least one byte-range-spec |
---|
752 | whose first-byte-pos is less than the current length of |
---|
753 | the entity-body, or at least one suffix-byte-range-spec with a non-zero |
---|
754 | suffix-length, then the byte-range-set is satisfiable. |
---|
755 | Otherwise, the byte-range-set is unsatisfiable. If the byte-range-set |
---|
756 | is unsatisfiable, the server &SHOULD; return a response with a status |
---|
757 | of 416 (Requested range not satisfiable). Otherwise, the server |
---|
758 | &SHOULD; return a response with a status of 206 (Partial Content) |
---|
759 | containing the satisfiable ranges of the entity-body. |
---|
760 | </t> |
---|
761 | <t> |
---|
762 | Examples of byte-ranges-specifier values (assuming an entity-body of |
---|
763 | length 10000): |
---|
764 | <list style="symbols"> |
---|
765 | <t>The first 500 bytes (byte offsets 0-499, inclusive): |
---|
766 | <figure><artwork type="example" x:indent-with=" "> |
---|
767 | bytes=0-499 |
---|
768 | </artwork></figure> |
---|
769 | </t> |
---|
770 | <t>The second 500 bytes (byte offsets 500-999, inclusive): |
---|
771 | <figure><artwork type="example" x:indent-with=" "> |
---|
772 | bytes=500-999 |
---|
773 | </artwork></figure> |
---|
774 | </t> |
---|
775 | <t>The final 500 bytes (byte offsets 9500-9999, inclusive): |
---|
776 | <figure><artwork type="example" x:indent-with=" "> |
---|
777 | bytes=-500 |
---|
778 | </artwork></figure> |
---|
779 | Or: |
---|
780 | <figure><artwork type="example" x:indent-with=" "> |
---|
781 | bytes=9500- |
---|
782 | </artwork></figure> |
---|
783 | </t> |
---|
784 | <t>The first and last bytes only (bytes 0 and 9999): |
---|
785 | <figure><artwork type="example" x:indent-with=" "> |
---|
786 | bytes=0-0,-1 |
---|
787 | </artwork></figure> |
---|
788 | </t> |
---|
789 | <t>Several legal but not canonical specifications of the second 500 |
---|
790 | bytes (byte offsets 500-999, inclusive): |
---|
791 | <figure><artwork type="example" x:indent-with=" "> |
---|
792 | bytes=500-600,601-999 |
---|
793 | bytes=500-700,601-999 |
---|
794 | </artwork></figure> |
---|
795 | </t> |
---|
796 | </list> |
---|
797 | </t> |
---|
798 | </section> |
---|
799 | |
---|
800 | <section title="Range Retrieval Requests" anchor="range.retrieval.requests"> |
---|
801 | <x:anchor-alias value="Range"/> |
---|
802 | <x:anchor-alias value="Range-v"/> |
---|
803 | <x:anchor-alias value="other-ranges-specifier"/> |
---|
804 | <x:anchor-alias value="other-range-set"/> |
---|
805 | <t> |
---|
806 | The "Range" request-header field defines the GET method (conditional or |
---|
807 | not) to request one or more sub-ranges of the response entity-body, instead |
---|
808 | of the entire entity body. |
---|
809 | </t> |
---|
810 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Range"/> |
---|
811 | <x:ref>Range</x:ref> = "Range" ":" <x:ref>OWS</x:ref> <x:ref>Range-v</x:ref> |
---|
812 | <x:ref>Range-v</x:ref> = <x:ref>byte-ranges-specifier</x:ref> |
---|
813 | / <x:ref>other-ranges-specifier</x:ref> |
---|
814 | <x:ref>other-ranges-specifier</x:ref> = <x:ref>other-range-unit</x:ref> "=" <x:ref>other-range-set</x:ref> |
---|
815 | <x:ref>other-range-set</x:ref> = 1*<x:ref>CHAR</x:ref> |
---|
816 | </artwork></figure> |
---|
817 | <t> |
---|
818 | A server &MAY; ignore the Range header. However, HTTP/1.1 origin |
---|
819 | servers and intermediate caches ought to support byte ranges when |
---|
820 | possible, since Range supports efficient recovery from partially |
---|
821 | failed transfers, and supports efficient partial retrieval of large |
---|
822 | entities. |
---|
823 | </t> |
---|
824 | <t> |
---|
825 | If the server supports the Range header and the specified range or |
---|
826 | ranges are appropriate for the entity: |
---|
827 | <list style="symbols"> |
---|
828 | <t>The presence of a Range header in an unconditional GET modifies |
---|
829 | what is returned if the GET is otherwise successful. In other |
---|
830 | words, the response carries a status code of 206 (Partial |
---|
831 | Content) instead of 200 (OK).</t> |
---|
832 | |
---|
833 | <t>The presence of a Range header in a conditional GET (a request |
---|
834 | using one or both of If-Modified-Since and If-None-Match, or |
---|
835 | one or both of If-Unmodified-Since and If-Match) modifies what |
---|
836 | is returned if the GET is otherwise successful and the |
---|
837 | condition is true. It does not affect the 304 (Not Modified) |
---|
838 | response returned if the conditional is false.</t> |
---|
839 | </list> |
---|
840 | </t> |
---|
841 | <t> |
---|
842 | In some cases, it might be more appropriate to use the If-Range |
---|
843 | header (see <xref target="header.if-range"/>) in addition to the Range header. |
---|
844 | </t> |
---|
845 | <t> |
---|
846 | If a proxy that supports ranges receives a Range request, forwards |
---|
847 | the request to an inbound server, and receives an entire entity in |
---|
848 | reply, it &SHOULD; only return the requested range to its client. It |
---|
849 | &SHOULD; store the entire received response in its cache if that is |
---|
850 | consistent with its cache allocation policies. |
---|
851 | </t> |
---|
852 | </section> |
---|
853 | </section> |
---|
854 | </section> |
---|
855 | |
---|
856 | <section title="IANA Considerations" anchor="IANA.considerations"> |
---|
857 | |
---|
858 | <section title="Status Code Registration" anchor="status.code.registration"> |
---|
859 | <t> |
---|
860 | The HTTP Status Code Registry located at <eref target="http://www.iana.org/assignments/http-status-codes"/> |
---|
861 | should be updated with the registrations below: |
---|
862 | </t> |
---|
863 | <?BEGININC p5-range.iana-status-codes ?> |
---|
864 | <!--AUTOGENERATED FROM extract-status-code-defs.xslt, do not edit manually--> |
---|
865 | <texttable align="left" suppress-title="true" anchor="iana.status.code.registration.table"> |
---|
866 | <ttcol>Value</ttcol> |
---|
867 | <ttcol>Description</ttcol> |
---|
868 | <ttcol>Reference</ttcol> |
---|
869 | <c>206</c> |
---|
870 | <c>Partial Content</c> |
---|
871 | <c> |
---|
872 | <xref target="status.206"/> |
---|
873 | </c> |
---|
874 | <c>416</c> |
---|
875 | <c>Requested Range Not Satisfiable</c> |
---|
876 | <c> |
---|
877 | <xref target="status.416"/> |
---|
878 | </c> |
---|
879 | </texttable> |
---|
880 | <!--(END)--> |
---|
881 | <?ENDINC p5-range.iana-status-codes ?> |
---|
882 | </section> |
---|
883 | |
---|
884 | <section title="Message Header Registration" anchor="message.header.registration"> |
---|
885 | <t> |
---|
886 | The Message Header Registry located at <eref target="http://www.iana.org/assignments/message-headers/message-header-index.html"/> should be updated |
---|
887 | with the permanent registrations below (see <xref target="RFC3864"/>): |
---|
888 | </t> |
---|
889 | <?BEGININC p5-range.iana-headers ?> |
---|
890 | <!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually--> |
---|
891 | <texttable align="left" suppress-title="true" anchor="iana.header.registration.table"> |
---|
892 | <ttcol>Header Field Name</ttcol> |
---|
893 | <ttcol>Protocol</ttcol> |
---|
894 | <ttcol>Status</ttcol> |
---|
895 | <ttcol>Reference</ttcol> |
---|
896 | |
---|
897 | <c>Accept-Ranges</c> |
---|
898 | <c>http</c> |
---|
899 | <c>standard</c> |
---|
900 | <c> |
---|
901 | <xref target="header.accept-ranges"/> |
---|
902 | </c> |
---|
903 | <c>Content-Range</c> |
---|
904 | <c>http</c> |
---|
905 | <c>standard</c> |
---|
906 | <c> |
---|
907 | <xref target="header.content-range"/> |
---|
908 | </c> |
---|
909 | <c>If-Range</c> |
---|
910 | <c>http</c> |
---|
911 | <c>standard</c> |
---|
912 | <c> |
---|
913 | <xref target="header.if-range"/> |
---|
914 | </c> |
---|
915 | <c>Range</c> |
---|
916 | <c>http</c> |
---|
917 | <c>standard</c> |
---|
918 | <c> |
---|
919 | <xref target="header.range"/> |
---|
920 | </c> |
---|
921 | </texttable> |
---|
922 | <!--(END)--> |
---|
923 | <?ENDINC p5-range.iana-headers ?> |
---|
924 | <t> |
---|
925 | The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force". |
---|
926 | </t> |
---|
927 | </section> |
---|
928 | </section> |
---|
929 | |
---|
930 | <section title="Security Considerations" anchor="security.considerations"> |
---|
931 | <t> |
---|
932 | No additional security considerations have been identified beyond |
---|
933 | those applicable to HTTP in general &messaging;. |
---|
934 | </t> |
---|
935 | </section> |
---|
936 | |
---|
937 | <section title="Acknowledgments" anchor="ack"> |
---|
938 | <t> |
---|
939 | Most of the specification of ranges is based on work originally done |
---|
940 | by Ari Luotonen and John Franks, with additional input from Steve |
---|
941 | Zilles, Daniel W. Connolly, Roy T. Fielding, Jim Gettys, Martin Hamilton, |
---|
942 | Koen Holtman, Shel Kaplan, Paul Leach, Alex Lopez-Ortiz, Larry Masinter, |
---|
943 | Jeff Mogul, Lou Montulli, David W. Morris, Luigi Rizzo, and Bill Weihl. |
---|
944 | </t> |
---|
945 | </section> |
---|
946 | </middle> |
---|
947 | <back> |
---|
948 | |
---|
949 | <references title="Normative References"> |
---|
950 | |
---|
951 | <reference anchor="Part1"> |
---|
952 | <front> |
---|
953 | <title abbrev="HTTP/1.1">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</title> |
---|
954 | <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor"> |
---|
955 | <organization abbrev="Day Software">Day Software</organization> |
---|
956 | <address><email>fielding@gbiv.com</email></address> |
---|
957 | </author> |
---|
958 | <author initials="J." surname="Gettys" fullname="Jim Gettys"> |
---|
959 | <organization abbrev="Alcatel-Lucent">Alcatel-Lucent Bell Labs</organization> |
---|
960 | <address><email>jg@freedesktop.org</email></address> |
---|
961 | </author> |
---|
962 | <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul"> |
---|
963 | <organization abbrev="HP">Hewlett-Packard Company</organization> |
---|
964 | <address><email>JeffMogul@acm.org</email></address> |
---|
965 | </author> |
---|
966 | <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen"> |
---|
967 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
968 | <address><email>henrikn@microsoft.com</email></address> |
---|
969 | </author> |
---|
970 | <author initials="L." surname="Masinter" fullname="Larry Masinter"> |
---|
971 | <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization> |
---|
972 | <address><email>LMM@acm.org</email></address> |
---|
973 | </author> |
---|
974 | <author initials="P." surname="Leach" fullname="Paul J. Leach"> |
---|
975 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
976 | <address><email>paulle@microsoft.com</email></address> |
---|
977 | </author> |
---|
978 | <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee"> |
---|
979 | <organization abbrev="W3C/MIT">World Wide Web Consortium</organization> |
---|
980 | <address><email>timbl@w3.org</email></address> |
---|
981 | </author> |
---|
982 | <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor"> |
---|
983 | <organization abbrev="W3C">World Wide Web Consortium</organization> |
---|
984 | <address><email>ylafon@w3.org</email></address> |
---|
985 | </author> |
---|
986 | <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor"> |
---|
987 | <organization abbrev="greenbytes">greenbytes GmbH</organization> |
---|
988 | <address><email>julian.reschke@greenbytes.de</email></address> |
---|
989 | </author> |
---|
990 | <date month="&ID-MONTH;" year="&ID-YEAR;"/> |
---|
991 | </front> |
---|
992 | <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"/> |
---|
993 | <x:source href="p1-messaging.xml" basename="p1-messaging"/> |
---|
994 | </reference> |
---|
995 | |
---|
996 | <reference anchor="Part3"> |
---|
997 | <front> |
---|
998 | <title abbrev="HTTP/1.1">HTTP/1.1, part 3: Message Payload and Content Negotiation</title> |
---|
999 | <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor"> |
---|
1000 | <organization abbrev="Day Software">Day Software</organization> |
---|
1001 | <address><email>fielding@gbiv.com</email></address> |
---|
1002 | </author> |
---|
1003 | <author initials="J." surname="Gettys" fullname="Jim Gettys"> |
---|
1004 | <organization abbrev="Alcatel-Lucent">Alcatel-Lucent Bell Labs</organization> |
---|
1005 | <address><email>jg@freedesktop.org</email></address> |
---|
1006 | </author> |
---|
1007 | <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul"> |
---|
1008 | <organization abbrev="HP">Hewlett-Packard Company</organization> |
---|
1009 | <address><email>JeffMogul@acm.org</email></address> |
---|
1010 | </author> |
---|
1011 | <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen"> |
---|
1012 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
1013 | <address><email>henrikn@microsoft.com</email></address> |
---|
1014 | </author> |
---|
1015 | <author initials="L." surname="Masinter" fullname="Larry Masinter"> |
---|
1016 | <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization> |
---|
1017 | <address><email>LMM@acm.org</email></address> |
---|
1018 | </author> |
---|
1019 | <author initials="P." surname="Leach" fullname="Paul J. Leach"> |
---|
1020 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
1021 | <address><email>paulle@microsoft.com</email></address> |
---|
1022 | </author> |
---|
1023 | <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee"> |
---|
1024 | <organization abbrev="W3C/MIT">World Wide Web Consortium</organization> |
---|
1025 | <address><email>timbl@w3.org</email></address> |
---|
1026 | </author> |
---|
1027 | <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor"> |
---|
1028 | <organization abbrev="W3C">World Wide Web Consortium</organization> |
---|
1029 | <address><email>ylafon@w3.org</email></address> |
---|
1030 | </author> |
---|
1031 | <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor"> |
---|
1032 | <organization abbrev="greenbytes">greenbytes GmbH</organization> |
---|
1033 | <address><email>julian.reschke@greenbytes.de</email></address> |
---|
1034 | </author> |
---|
1035 | <date month="&ID-MONTH;" year="&ID-YEAR;"/> |
---|
1036 | </front> |
---|
1037 | <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p3-payload-&ID-VERSION;"/> |
---|
1038 | <x:source href="p3-payload.xml" basename="p3-payload"/> |
---|
1039 | </reference> |
---|
1040 | |
---|
1041 | <reference anchor="Part4"> |
---|
1042 | <front> |
---|
1043 | <title abbrev="HTTP/1.1">HTTP/1.1, part 4: Conditional Requests</title> |
---|
1044 | <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor"> |
---|
1045 | <organization abbrev="Day Software">Day Software</organization> |
---|
1046 | <address><email>fielding@gbiv.com</email></address> |
---|
1047 | </author> |
---|
1048 | <author initials="J." surname="Gettys" fullname="Jim Gettys"> |
---|
1049 | <organization abbrev="Alcatel-Lucent">Alcatel-Lucent Bell Labs</organization> |
---|
1050 | <address><email>jg@freedesktop.org</email></address> |
---|
1051 | </author> |
---|
1052 | <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul"> |
---|
1053 | <organization abbrev="HP">Hewlett-Packard Company</organization> |
---|
1054 | <address><email>JeffMogul@acm.org</email></address> |
---|
1055 | </author> |
---|
1056 | <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen"> |
---|
1057 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
1058 | <address><email>henrikn@microsoft.com</email></address> |
---|
1059 | </author> |
---|
1060 | <author initials="L." surname="Masinter" fullname="Larry Masinter"> |
---|
1061 | <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization> |
---|
1062 | <address><email>LMM@acm.org</email></address> |
---|
1063 | </author> |
---|
1064 | <author initials="P." surname="Leach" fullname="Paul J. Leach"> |
---|
1065 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
1066 | <address><email>paulle@microsoft.com</email></address> |
---|
1067 | </author> |
---|
1068 | <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee"> |
---|
1069 | <organization abbrev="W3C/MIT">World Wide Web Consortium</organization> |
---|
1070 | <address><email>timbl@w3.org</email></address> |
---|
1071 | </author> |
---|
1072 | <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor"> |
---|
1073 | <organization abbrev="W3C">World Wide Web Consortium</organization> |
---|
1074 | <address><email>ylafon@w3.org</email></address> |
---|
1075 | </author> |
---|
1076 | <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor"> |
---|
1077 | <organization abbrev="greenbytes">greenbytes GmbH</organization> |
---|
1078 | <address><email>julian.reschke@greenbytes.de</email></address> |
---|
1079 | </author> |
---|
1080 | <date month="&ID-MONTH;" year="&ID-YEAR;"/> |
---|
1081 | </front> |
---|
1082 | <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p4-conditional-&ID-VERSION;"/> |
---|
1083 | <x:source href="p4-conditional.xml" basename="p4-conditional"/> |
---|
1084 | </reference> |
---|
1085 | |
---|
1086 | <reference anchor="Part6"> |
---|
1087 | <front> |
---|
1088 | <title abbrev="HTTP/1.1">HTTP/1.1, part 6: Caching</title> |
---|
1089 | <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor"> |
---|
1090 | <organization abbrev="Day Software">Day Software</organization> |
---|
1091 | <address><email>fielding@gbiv.com</email></address> |
---|
1092 | </author> |
---|
1093 | <author initials="J." surname="Gettys" fullname="Jim Gettys"> |
---|
1094 | <organization abbrev="Alcatel-Lucent">Alcatel-Lucent Bell Labs</organization> |
---|
1095 | <address><email>jg@freedesktop.org</email></address> |
---|
1096 | </author> |
---|
1097 | <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul"> |
---|
1098 | <organization abbrev="HP">Hewlett-Packard Company</organization> |
---|
1099 | <address><email>JeffMogul@acm.org</email></address> |
---|
1100 | </author> |
---|
1101 | <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen"> |
---|
1102 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
1103 | <address><email>henrikn@microsoft.com</email></address> |
---|
1104 | </author> |
---|
1105 | <author initials="L." surname="Masinter" fullname="Larry Masinter"> |
---|
1106 | <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization> |
---|
1107 | <address><email>LMM@acm.org</email></address> |
---|
1108 | </author> |
---|
1109 | <author initials="P." surname="Leach" fullname="Paul J. Leach"> |
---|
1110 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
1111 | <address><email>paulle@microsoft.com</email></address> |
---|
1112 | </author> |
---|
1113 | <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee"> |
---|
1114 | <organization abbrev="W3C/MIT">World Wide Web Consortium</organization> |
---|
1115 | <address><email>timbl@w3.org</email></address> |
---|
1116 | </author> |
---|
1117 | <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor"> |
---|
1118 | <organization abbrev="W3C">World Wide Web Consortium</organization> |
---|
1119 | <address><email>ylafon@w3.org</email></address> |
---|
1120 | </author> |
---|
1121 | <author initials="M." surname="Nottingham" fullname="Mark Nottingham" role="editor"> |
---|
1122 | <address><email>mnot@mnot.net</email></address> |
---|
1123 | </author> |
---|
1124 | <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor"> |
---|
1125 | <organization abbrev="greenbytes">greenbytes GmbH</organization> |
---|
1126 | <address><email>julian.reschke@greenbytes.de</email></address> |
---|
1127 | </author> |
---|
1128 | <date month="&ID-MONTH;" year="&ID-YEAR;"/> |
---|
1129 | </front> |
---|
1130 | <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-&ID-VERSION;"/> |
---|
1131 | <x:source href="p6-cache.xml" basename="p6-cache"/> |
---|
1132 | </reference> |
---|
1133 | |
---|
1134 | <reference anchor="RFC2046"> |
---|
1135 | <front> |
---|
1136 | <title abbrev="Media Types">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</title> |
---|
1137 | <author initials="N." surname="Freed" fullname="Ned Freed"> |
---|
1138 | <organization>Innosoft International, Inc.</organization> |
---|
1139 | <address><email>ned@innosoft.com</email></address> |
---|
1140 | </author> |
---|
1141 | <author initials="N." surname="Borenstein" fullname="Nathaniel S. Borenstein"> |
---|
1142 | <organization>First Virtual Holdings</organization> |
---|
1143 | <address><email>nsb@nsb.fv.com</email></address> |
---|
1144 | </author> |
---|
1145 | <date month="November" year="1996"/> |
---|
1146 | </front> |
---|
1147 | <seriesInfo name="RFC" value="2046"/> |
---|
1148 | </reference> |
---|
1149 | |
---|
1150 | <reference anchor="RFC2119"> |
---|
1151 | <front> |
---|
1152 | <title>Key words for use in RFCs to Indicate Requirement Levels</title> |
---|
1153 | <author initials="S." surname="Bradner" fullname="Scott Bradner"> |
---|
1154 | <organization>Harvard University</organization> |
---|
1155 | <address><email>sob@harvard.edu</email></address> |
---|
1156 | </author> |
---|
1157 | <date month="March" year="1997"/> |
---|
1158 | </front> |
---|
1159 | <seriesInfo name="BCP" value="14"/> |
---|
1160 | <seriesInfo name="RFC" value="2119"/> |
---|
1161 | </reference> |
---|
1162 | |
---|
1163 | <reference anchor="RFC5234"> |
---|
1164 | <front> |
---|
1165 | <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title> |
---|
1166 | <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor"> |
---|
1167 | <organization>Brandenburg InternetWorking</organization> |
---|
1168 | <address> |
---|
1169 | <email>dcrocker@bbiw.net</email> |
---|
1170 | </address> |
---|
1171 | </author> |
---|
1172 | <author initials="P." surname="Overell" fullname="Paul Overell"> |
---|
1173 | <organization>THUS plc.</organization> |
---|
1174 | <address> |
---|
1175 | <email>paul.overell@thus.net</email> |
---|
1176 | </address> |
---|
1177 | </author> |
---|
1178 | <date month="January" year="2008"/> |
---|
1179 | </front> |
---|
1180 | <seriesInfo name="STD" value="68"/> |
---|
1181 | <seriesInfo name="RFC" value="5234"/> |
---|
1182 | </reference> |
---|
1183 | |
---|
1184 | </references> |
---|
1185 | |
---|
1186 | <references title="Informative References"> |
---|
1187 | |
---|
1188 | <reference anchor="RFC2616"> |
---|
1189 | <front> |
---|
1190 | <title>Hypertext Transfer Protocol -- HTTP/1.1</title> |
---|
1191 | <author initials="R." surname="Fielding" fullname="R. Fielding"> |
---|
1192 | <organization>University of California, Irvine</organization> |
---|
1193 | <address><email>fielding@ics.uci.edu</email></address> |
---|
1194 | </author> |
---|
1195 | <author initials="J." surname="Gettys" fullname="J. Gettys"> |
---|
1196 | <organization>W3C</organization> |
---|
1197 | <address><email>jg@w3.org</email></address> |
---|
1198 | </author> |
---|
1199 | <author initials="J." surname="Mogul" fullname="J. Mogul"> |
---|
1200 | <organization>Compaq Computer Corporation</organization> |
---|
1201 | <address><email>mogul@wrl.dec.com</email></address> |
---|
1202 | </author> |
---|
1203 | <author initials="H." surname="Frystyk" fullname="H. Frystyk"> |
---|
1204 | <organization>MIT Laboratory for Computer Science</organization> |
---|
1205 | <address><email>frystyk@w3.org</email></address> |
---|
1206 | </author> |
---|
1207 | <author initials="L." surname="Masinter" fullname="L. Masinter"> |
---|
1208 | <organization>Xerox Corporation</organization> |
---|
1209 | <address><email>masinter@parc.xerox.com</email></address> |
---|
1210 | </author> |
---|
1211 | <author initials="P." surname="Leach" fullname="P. Leach"> |
---|
1212 | <organization>Microsoft Corporation</organization> |
---|
1213 | <address><email>paulle@microsoft.com</email></address> |
---|
1214 | </author> |
---|
1215 | <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee"> |
---|
1216 | <organization>W3C</organization> |
---|
1217 | <address><email>timbl@w3.org</email></address> |
---|
1218 | </author> |
---|
1219 | <date month="June" year="1999"/> |
---|
1220 | </front> |
---|
1221 | <seriesInfo name="RFC" value="2616"/> |
---|
1222 | </reference> |
---|
1223 | |
---|
1224 | <reference anchor='RFC3864'> |
---|
1225 | <front> |
---|
1226 | <title>Registration Procedures for Message Header Fields</title> |
---|
1227 | <author initials='G.' surname='Klyne' fullname='G. Klyne'> |
---|
1228 | <organization>Nine by Nine</organization> |
---|
1229 | <address><email>GK-IETF@ninebynine.org</email></address> |
---|
1230 | </author> |
---|
1231 | <author initials='M.' surname='Nottingham' fullname='M. Nottingham'> |
---|
1232 | <organization>BEA Systems</organization> |
---|
1233 | <address><email>mnot@pobox.com</email></address> |
---|
1234 | </author> |
---|
1235 | <author initials='J.' surname='Mogul' fullname='J. Mogul'> |
---|
1236 | <organization>HP Labs</organization> |
---|
1237 | <address><email>JeffMogul@acm.org</email></address> |
---|
1238 | </author> |
---|
1239 | <date year='2004' month='September' /> |
---|
1240 | </front> |
---|
1241 | <seriesInfo name='BCP' value='90' /> |
---|
1242 | <seriesInfo name='RFC' value='3864' /> |
---|
1243 | </reference> |
---|
1244 | |
---|
1245 | <reference anchor="RFC4288"> |
---|
1246 | <front> |
---|
1247 | <title>Media Type Specifications and Registration Procedures</title> |
---|
1248 | <author initials="N." surname="Freed" fullname="N. Freed"> |
---|
1249 | <organization>Sun Microsystems</organization> |
---|
1250 | <address> |
---|
1251 | <email>ned.freed@mrochek.com</email> |
---|
1252 | </address> |
---|
1253 | </author> |
---|
1254 | <author initials="J." surname="Klensin" fullname="J. Klensin"> |
---|
1255 | <address> |
---|
1256 | <email>klensin+ietf@jck.com</email> |
---|
1257 | </address> |
---|
1258 | </author> |
---|
1259 | <date year="2005" month="December"/> |
---|
1260 | </front> |
---|
1261 | <seriesInfo name="BCP" value="13"/> |
---|
1262 | <seriesInfo name="RFC" value="4288"/> |
---|
1263 | </reference> |
---|
1264 | |
---|
1265 | </references> |
---|
1266 | |
---|
1267 | <section title="Internet Media Type multipart/byteranges" anchor="internet.media.type.multipart.byteranges"> |
---|
1268 | <iref item="Media Type" subitem="multipart/byteranges" primary="true"/> |
---|
1269 | <iref item="multipart/byteranges Media Type" primary="true"/> |
---|
1270 | <t> |
---|
1271 | When an HTTP 206 (Partial Content) response message includes the |
---|
1272 | content of multiple ranges (a response to a request for multiple |
---|
1273 | non-overlapping ranges), these are transmitted as a multipart |
---|
1274 | message-body (<xref target="RFC2046" x:fmt="," x:sec="5.1"/>). The media type for this purpose is called |
---|
1275 | "multipart/byteranges". The following is to be registered with IANA <xref target="RFC4288"/>. |
---|
1276 | </t> |
---|
1277 | <x:note> |
---|
1278 | <t> |
---|
1279 | <x:h>Note:</x:h> Despite the name "multipart/byteranges" is not limited to the byte ranges only. |
---|
1280 | </t> |
---|
1281 | </x:note> |
---|
1282 | <t> |
---|
1283 | The multipart/byteranges media type includes one or more parts, each |
---|
1284 | with its own Content-Type and Content-Range fields. The required |
---|
1285 | boundary parameter specifies the boundary string used to separate |
---|
1286 | each body-part. |
---|
1287 | </t> |
---|
1288 | <t> |
---|
1289 | <list style="hanging" x:indent="12em"> |
---|
1290 | <t hangText="Type name:"> |
---|
1291 | multipart |
---|
1292 | </t> |
---|
1293 | <t hangText="Subtype name:"> |
---|
1294 | byteranges |
---|
1295 | </t> |
---|
1296 | <t hangText="Required parameters:"> |
---|
1297 | boundary |
---|
1298 | </t> |
---|
1299 | <t hangText="Optional parameters:"> |
---|
1300 | none |
---|
1301 | </t> |
---|
1302 | <t hangText="Encoding considerations:"> |
---|
1303 | only "7bit", "8bit", or "binary" are permitted |
---|
1304 | </t> |
---|
1305 | <t hangText="Security considerations:"> |
---|
1306 | none |
---|
1307 | </t> |
---|
1308 | <t hangText="Interoperability considerations:"> |
---|
1309 | none |
---|
1310 | </t> |
---|
1311 | <t hangText="Published specification:"> |
---|
1312 | This specification (see <xref target="internet.media.type.multipart.byteranges"/>). |
---|
1313 | </t> |
---|
1314 | <t hangText="Applications that use this media type:"> |
---|
1315 | </t> |
---|
1316 | <t hangText="Additional information:"> |
---|
1317 | <list style="hanging"> |
---|
1318 | <t hangText="Magic number(s):">none</t> |
---|
1319 | <t hangText="File extension(s):">none</t> |
---|
1320 | <t hangText="Macintosh file type code(s):">none</t> |
---|
1321 | </list> |
---|
1322 | </t> |
---|
1323 | <t hangText="Person and email address to contact for further information:"> |
---|
1324 | See Authors Section. |
---|
1325 | </t> |
---|
1326 | <t hangText="Intended usage:"> |
---|
1327 | COMMON |
---|
1328 | </t> |
---|
1329 | <t hangText="Restrictions on usage:"> |
---|
1330 | none |
---|
1331 | </t> |
---|
1332 | <t hangText="Author/Change controller:"> |
---|
1333 | IESG |
---|
1334 | </t> |
---|
1335 | </list> |
---|
1336 | </t> |
---|
1337 | <figure><preamble> |
---|
1338 | For example: |
---|
1339 | </preamble><artwork type="example"> |
---|
1340 | HTTP/1.1 206 Partial Content |
---|
1341 | Date: Wed, 15 Nov 1995 06:25:24 GMT |
---|
1342 | Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT |
---|
1343 | Content-type: multipart/byteranges; boundary=THIS_STRING_SEPARATES |
---|
1344 | |
---|
1345 | --THIS_STRING_SEPARATES |
---|
1346 | Content-type: application/pdf |
---|
1347 | Content-range: bytes 500-999/8000 |
---|
1348 | |
---|
1349 | ...the first range... |
---|
1350 | --THIS_STRING_SEPARATES |
---|
1351 | Content-type: application/pdf |
---|
1352 | Content-range: bytes 7000-7999/8000 |
---|
1353 | |
---|
1354 | ...the second range |
---|
1355 | --THIS_STRING_SEPARATES-- |
---|
1356 | </artwork></figure> |
---|
1357 | <figure><preamble> |
---|
1358 | Other example: |
---|
1359 | </preamble> |
---|
1360 | <artwork type="example"> |
---|
1361 | HTTP/1.1 206 Partial Content |
---|
1362 | Date: Tue, 14 Nov 1995 06:25:24 GMT |
---|
1363 | Last-Modified: Tue, 14 July 04:58:08 GMT |
---|
1364 | Content-type: multipart/byteranges; boundary=THIS_STRING_SEPARATES |
---|
1365 | |
---|
1366 | --THIS_STRING_SEPARATES |
---|
1367 | Content-type: video/example |
---|
1368 | Content-range: exampleunit 1.2-4.3/25 |
---|
1369 | |
---|
1370 | ...the first range... |
---|
1371 | --THIS_STRING_SEPARATES |
---|
1372 | Content-type: video/example |
---|
1373 | Content-range: exampleunit 11.2-14.3/25 |
---|
1374 | |
---|
1375 | ...the second range |
---|
1376 | --THIS_STRING_SEPARATES-- |
---|
1377 | </artwork> |
---|
1378 | </figure> |
---|
1379 | <t> |
---|
1380 | Notes: |
---|
1381 | <list style="numbers"> |
---|
1382 | <t>Additional CRLFs may precede the first boundary string in the |
---|
1383 | entity.</t> |
---|
1384 | |
---|
1385 | <t>Although <xref target="RFC2046"/> permits the boundary string to be |
---|
1386 | quoted, some existing implementations handle a quoted boundary |
---|
1387 | string incorrectly.</t> |
---|
1388 | |
---|
1389 | <t>A number of browsers and servers were coded to an early draft |
---|
1390 | of the byteranges specification to use a media type of |
---|
1391 | multipart/x-byteranges<iref item="multipart/x-byteranges Media Type"/><iref item="Media Type" subitem="multipart/x-byteranges"/>, which is almost, but not quite |
---|
1392 | compatible with the version documented in HTTP/1.1.</t> |
---|
1393 | </list> |
---|
1394 | </t> |
---|
1395 | </section> |
---|
1396 | |
---|
1397 | <section title="Compatibility with Previous Versions" anchor="compatibility"> |
---|
1398 | <section title="Changes from RFC 2068" anchor="changes.from.rfc.2068"> |
---|
1399 | <t> |
---|
1400 | Transfer-coding and message lengths all interact in ways that |
---|
1401 | required fixing exactly when chunked encoding is used (to allow for |
---|
1402 | transfer encoding that may not be self delimiting); it was important |
---|
1403 | to straighten out exactly how message lengths are computed. |
---|
1404 | (<xref target="header.content-range"/>, |
---|
1405 | see also <xref target="Part1"/>) |
---|
1406 | </t> |
---|
1407 | <t> |
---|
1408 | There are situations where a server (especially a proxy) does not |
---|
1409 | know the full length of a response but is capable of serving a |
---|
1410 | byterange request. We therefore need a mechanism to allow byteranges |
---|
1411 | with a content-range not indicating the full length of the message. |
---|
1412 | (<xref target="header.content-range"/>) |
---|
1413 | </t> |
---|
1414 | <t> |
---|
1415 | Range request responses would become very verbose if all meta-data |
---|
1416 | were always returned; by allowing the server to only send needed |
---|
1417 | headers in a 206 response, this problem can be avoided. |
---|
1418 | (Section <xref target="status.206" format="counter"/> |
---|
1419 | and <xref target="header.if-range" format="counter"/>) |
---|
1420 | </t> |
---|
1421 | <t> |
---|
1422 | Fix problem with unsatisfiable range requests; there are two cases: |
---|
1423 | syntactic problems, and range doesn't exist in the document. The 416 |
---|
1424 | status code was needed to resolve this ambiguity needed to indicate |
---|
1425 | an error for a byte range request that falls outside of the actual |
---|
1426 | contents of a document. (Section <xref target="status.416" format="counter"/>, <xref target="header.content-range" format="counter"/>) |
---|
1427 | </t> |
---|
1428 | </section> |
---|
1429 | |
---|
1430 | <section title="Changes from RFC 2616" anchor="changes.from.rfc.2616"> |
---|
1431 | <t> |
---|
1432 | Clarify that it is not ok to use a weak cache validator in a 206 response. |
---|
1433 | (<xref target="status.206"/>) |
---|
1434 | </t> |
---|
1435 | <t> |
---|
1436 | Clarify that multipart/byteranges can consist of a single part. |
---|
1437 | (<xref target="internet.media.type.multipart.byteranges"/>) |
---|
1438 | </t> |
---|
1439 | |
---|
1440 | </section> |
---|
1441 | |
---|
1442 | </section> |
---|
1443 | |
---|
1444 | <?BEGININC p5-range.abnf-appendix ?> |
---|
1445 | <section xmlns:x="http://purl.org/net/xml2rfc/ext" title="Collected ABNF" anchor="collected.abnf"> |
---|
1446 | <figure> |
---|
1447 | <artwork type="abnf" name="p5-range.parsed-abnf"> |
---|
1448 | <x:ref>Accept-Ranges</x:ref> = "Accept-Ranges:" OWS Accept-Ranges-v |
---|
1449 | <x:ref>Accept-Ranges-v</x:ref> = acceptable-ranges |
---|
1450 | |
---|
1451 | <x:ref>Content-Range</x:ref> = "Content-Range:" OWS Content-Range-v |
---|
1452 | <x:ref>Content-Range-v</x:ref> = content-range-spec |
---|
1453 | |
---|
1454 | <x:ref>HTTP-date</x:ref> = <HTTP-date, defined in [Part1], Section 6.1> |
---|
1455 | |
---|
1456 | <x:ref>If-Range</x:ref> = "If-Range:" OWS If-Range-v |
---|
1457 | <x:ref>If-Range-v</x:ref> = entity-tag / HTTP-date |
---|
1458 | |
---|
1459 | <x:ref>OWS</x:ref> = <OWS, defined in [Part1], Section 1.2.2> |
---|
1460 | |
---|
1461 | <x:ref>Range</x:ref> = "Range:" OWS Range-v |
---|
1462 | <x:ref>Range-v</x:ref> = byte-ranges-specifier / other-ranges-specifier |
---|
1463 | |
---|
1464 | <x:ref>acceptable-ranges</x:ref> = ( *( "," OWS ) range-unit *( OWS "," [ OWS |
---|
1465 | range-unit ] ) ) / "none" |
---|
1466 | |
---|
1467 | <x:ref>byte-content-range-spec</x:ref> = bytes-unit SP byte-range-resp-spec "/" ( |
---|
1468 | instance-length / "*" ) |
---|
1469 | <x:ref>byte-range-resp-spec</x:ref> = ( first-byte-pos "-" last-byte-pos ) / "*" |
---|
1470 | <x:ref>byte-range-set</x:ref> = ( *( "," OWS ) byte-range-spec ) / ( |
---|
1471 | suffix-byte-range-spec *( OWS "," [ ( OWS byte-range-spec ) / |
---|
1472 | suffix-byte-range-spec ] ) ) |
---|
1473 | <x:ref>byte-range-spec</x:ref> = first-byte-pos "-" [ last-byte-pos ] |
---|
1474 | <x:ref>byte-ranges-specifier</x:ref> = bytes-unit "=" byte-range-set |
---|
1475 | <x:ref>bytes-unit</x:ref> = "bytes" |
---|
1476 | |
---|
1477 | <x:ref>content-range-spec</x:ref> = byte-content-range-spec / |
---|
1478 | other-content-range-spec |
---|
1479 | |
---|
1480 | <x:ref>entity-tag</x:ref> = <entity-tag, defined in [Part4], Section 2> |
---|
1481 | |
---|
1482 | <x:ref>first-byte-pos</x:ref> = 1*DIGIT |
---|
1483 | |
---|
1484 | <x:ref>instance-length</x:ref> = 1*DIGIT |
---|
1485 | |
---|
1486 | <x:ref>last-byte-pos</x:ref> = 1*DIGIT |
---|
1487 | |
---|
1488 | <x:ref>other-content-range-spec</x:ref> = other-range-unit SP other-range-resp-spec |
---|
1489 | <x:ref>other-range-resp-spec</x:ref> = *CHAR |
---|
1490 | <x:ref>other-range-set</x:ref> = 1*CHAR |
---|
1491 | <x:ref>other-range-unit</x:ref> = token |
---|
1492 | <x:ref>other-ranges-specifier</x:ref> = other-range-unit "=" other-range-set |
---|
1493 | |
---|
1494 | <x:ref>range-unit</x:ref> = bytes-unit / other-range-unit |
---|
1495 | |
---|
1496 | <x:ref>suffix-byte-range-spec</x:ref> = "-" suffix-length |
---|
1497 | <x:ref>suffix-length</x:ref> = 1*DIGIT |
---|
1498 | |
---|
1499 | <x:ref>token</x:ref> = <token, defined in [Part1], Section 1.2.2> |
---|
1500 | </artwork> |
---|
1501 | </figure> |
---|
1502 | <figure><preamble>ABNF diagnostics:</preamble><artwork type="inline"> |
---|
1503 | ; Accept-Ranges defined but not used |
---|
1504 | ; Content-Range defined but not used |
---|
1505 | ; If-Range defined but not used |
---|
1506 | ; Range defined but not used |
---|
1507 | </artwork></figure></section> |
---|
1508 | <?ENDINC p5-range.abnf-appendix ?> |
---|
1509 | |
---|
1510 | |
---|
1511 | <section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log"> |
---|
1512 | |
---|
1513 | <section title="Since RFC2616"> |
---|
1514 | <t> |
---|
1515 | Extracted relevant partitions from <xref target="RFC2616"/>. |
---|
1516 | </t> |
---|
1517 | </section> |
---|
1518 | |
---|
1519 | <section title="Since draft-ietf-httpbis-p5-range-00"> |
---|
1520 | <t> |
---|
1521 | Closed issues: |
---|
1522 | <list style="symbols"> |
---|
1523 | <t> |
---|
1524 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/18"/>: |
---|
1525 | "Cache validators in 206 responses" |
---|
1526 | (<eref target="http://purl.org/NET/http-errata#ifrange206"/>) |
---|
1527 | </t> |
---|
1528 | <t> |
---|
1529 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/35"/>: |
---|
1530 | "Normative and Informative references" |
---|
1531 | </t> |
---|
1532 | <t> |
---|
1533 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/86"/>: |
---|
1534 | "Normative up-to-date references" |
---|
1535 | </t> |
---|
1536 | </list> |
---|
1537 | </t> |
---|
1538 | </section> |
---|
1539 | |
---|
1540 | <section title="Since draft-ietf-httpbis-p5-range-01"> |
---|
1541 | <t> |
---|
1542 | Closed issues: |
---|
1543 | <list style="symbols"> |
---|
1544 | <t> |
---|
1545 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/55"/>: |
---|
1546 | "Updating to RFC4288" |
---|
1547 | </t> |
---|
1548 | </list> |
---|
1549 | </t> |
---|
1550 | <t> |
---|
1551 | Ongoing work on ABNF conversion (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/36"/>): |
---|
1552 | <list style="symbols"> |
---|
1553 | <t> |
---|
1554 | Add explicit references to BNF syntax and rules imported from other parts of the specification. |
---|
1555 | </t> |
---|
1556 | </list> |
---|
1557 | </t> |
---|
1558 | </section> |
---|
1559 | |
---|
1560 | <section title="Since draft-ietf-httpbis-p5-range-02" anchor="changes.since.02"> |
---|
1561 | <t> |
---|
1562 | Ongoing work on IANA Message Header Registration (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/40"/>): |
---|
1563 | <list style="symbols"> |
---|
1564 | <t> |
---|
1565 | Reference RFC 3984, and update header registrations for headers defined |
---|
1566 | in this document. |
---|
1567 | </t> |
---|
1568 | </list> |
---|
1569 | </t> |
---|
1570 | </section> |
---|
1571 | |
---|
1572 | <section title="Since draft-ietf-httpbis-p5-range-03" anchor="changes.since.03"> |
---|
1573 | <t> |
---|
1574 | </t> |
---|
1575 | </section> |
---|
1576 | |
---|
1577 | <section title="Since draft-ietf-httpbis-p5-range-04" anchor="changes.since.04"> |
---|
1578 | <t> |
---|
1579 | Closed issues: |
---|
1580 | <list style="symbols"> |
---|
1581 | <t> |
---|
1582 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/133"/>: |
---|
1583 | "multipart/byteranges minimum number of parts" |
---|
1584 | </t> |
---|
1585 | </list> |
---|
1586 | </t> |
---|
1587 | <t> |
---|
1588 | Ongoing work on ABNF conversion (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/36"/>): |
---|
1589 | <list style="symbols"> |
---|
1590 | <t> |
---|
1591 | Use "/" instead of "|" for alternatives. |
---|
1592 | </t> |
---|
1593 | <t> |
---|
1594 | Introduce new ABNF rules for "bad" whitespace ("BWS"), optional |
---|
1595 | whitespace ("OWS") and required whitespace ("RWS"). |
---|
1596 | </t> |
---|
1597 | <t> |
---|
1598 | Rewrite ABNFs to spell out whitespace rules, factor out |
---|
1599 | header value format definitions. |
---|
1600 | </t> |
---|
1601 | </list> |
---|
1602 | </t> |
---|
1603 | </section> |
---|
1604 | |
---|
1605 | <section title="Since draft-ietf-httpbis-p5-range-05" anchor="changes.since.05"> |
---|
1606 | <t> |
---|
1607 | Closed issues: |
---|
1608 | <list style="symbols"> |
---|
1609 | <t> |
---|
1610 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/142"/>: |
---|
1611 | "State base for *-byte-pos and suffix-length" |
---|
1612 | </t> |
---|
1613 | </list> |
---|
1614 | </t> |
---|
1615 | <t> |
---|
1616 | Ongoing work on Custom Ranges (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/85"/>): |
---|
1617 | <list style="symbols"> |
---|
1618 | <t> |
---|
1619 | Remove bias in favor of byte ranges; allow custom ranges in ABNF. |
---|
1620 | </t> |
---|
1621 | </list> |
---|
1622 | </t> |
---|
1623 | <t> |
---|
1624 | Final work on ABNF conversion (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/36"/>): |
---|
1625 | <list style="symbols"> |
---|
1626 | <t> |
---|
1627 | Add appendix containing collected and expanded ABNF, reorganize ABNF introduction. |
---|
1628 | </t> |
---|
1629 | </list> |
---|
1630 | </t> |
---|
1631 | </section> |
---|
1632 | |
---|
1633 | <section title="Since draft-ietf-httpbis-p5-range-06" anchor="changes.since.06"> |
---|
1634 | <t> |
---|
1635 | Closed issues: |
---|
1636 | <list style="symbols"> |
---|
1637 | <t> |
---|
1638 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/161"/>: |
---|
1639 | "base for numeric protocol elements" |
---|
1640 | </t> |
---|
1641 | </list> |
---|
1642 | </t> |
---|
1643 | </section> |
---|
1644 | |
---|
1645 | <section title="Since draft-ietf-httpbis-p5-range-07" anchor="changes.since.07"> |
---|
1646 | <t> |
---|
1647 | Closed issues: |
---|
1648 | <list style="symbols"> |
---|
1649 | <t> |
---|
1650 | Fixed discrepancy in the If-Range definition about allowed validators. |
---|
1651 | </t> |
---|
1652 | <t> |
---|
1653 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/150" />: "multipart/byteranges for custom range units" |
---|
1654 | </t> |
---|
1655 | <t> |
---|
1656 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/151" />: "range unit missing from other-ranges-specifier in Range header" |
---|
1657 | </t> |
---|
1658 | <t> |
---|
1659 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/198"/>: |
---|
1660 | "move IANA registrations for optional status codes" |
---|
1661 | </t> |
---|
1662 | </list> |
---|
1663 | </t> |
---|
1664 | </section> |
---|
1665 | |
---|
1666 | <section title="Since draft-ietf-httpbis-p5-range-08" anchor="changes.since.08"> |
---|
1667 | <t> |
---|
1668 | No significant changes. |
---|
1669 | </t> |
---|
1670 | </section> |
---|
1671 | |
---|
1672 | <section title="Since draft-ietf-httpbis-p5-range-09" anchor="changes.since.09"> |
---|
1673 | <t> |
---|
1674 | No significant changes. |
---|
1675 | </t> |
---|
1676 | </section> |
---|
1677 | |
---|
1678 | <section title="Since draft-ietf-httpbis-p5-range-10" anchor="changes.since.10"> |
---|
1679 | <t> |
---|
1680 | None yet. |
---|
1681 | </t> |
---|
1682 | </section> |
---|
1683 | |
---|
1684 | </section> |
---|
1685 | |
---|
1686 | </back> |
---|
1687 | </rfc> |
---|