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 "January"> |
---|
16 | <!ENTITY ID-YEAR "2008"> |
---|
17 | <!ENTITY messaging "<xref target='Part1' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
18 | <!ENTITY weak-and-strong-validators "<xref target='Part4' x:rel='#weak.and.strong.validators' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> |
---|
19 | ]> |
---|
20 | <?rfc toc="yes" ?> |
---|
21 | <?rfc symrefs="yes" ?> |
---|
22 | <?rfc sortrefs="yes" ?> |
---|
23 | <?rfc compact="yes"?> |
---|
24 | <?rfc subcompact="no" ?> |
---|
25 | <?rfc linkmailto="no" ?> |
---|
26 | <?rfc editing="no" ?> |
---|
27 | <?rfc-ext allow-markup-in-artwork="yes" ?> |
---|
28 | <?rfc-ext include-references-in-index="yes" ?> |
---|
29 | <rfc obsoletes="2068, 2616" category="std" |
---|
30 | ipr="full3978" docName="draft-ietf-httpbis-p5-range-&ID-VERSION;" |
---|
31 | xmlns:x='http://purl.org/net/xml2rfc/ext' xmlns:ed="http://greenbytes.de/2002/rfcedit"> |
---|
32 | <front> |
---|
33 | |
---|
34 | <title abbrev="HTTP/1.1, Part 5">HTTP/1.1, part 5: Range Requests and Partial Responses</title> |
---|
35 | |
---|
36 | <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor"> |
---|
37 | <organization abbrev="Day Software">Day Software</organization> |
---|
38 | <address> |
---|
39 | <postal> |
---|
40 | <street>23 Corporate Plaza DR, Suite 280</street> |
---|
41 | <city>Newport Beach</city> |
---|
42 | <region>CA</region> |
---|
43 | <code>92660</code> |
---|
44 | <country>USA</country> |
---|
45 | </postal> |
---|
46 | <phone>+1-949-706-5300</phone> |
---|
47 | <facsimile>+1-949-706-5305</facsimile> |
---|
48 | <email>fielding@gbiv.com</email> |
---|
49 | <uri>http://roy.gbiv.com/</uri> |
---|
50 | </address> |
---|
51 | </author> |
---|
52 | |
---|
53 | <author initials="J." surname="Gettys" fullname="Jim Gettys"> |
---|
54 | <organization>One Laptop per Child</organization> |
---|
55 | <address> |
---|
56 | <postal> |
---|
57 | <street>21 Oak Knoll Road</street> |
---|
58 | <city>Carlisle</city> |
---|
59 | <region>MA</region> |
---|
60 | <code>01741</code> |
---|
61 | <country>USA</country> |
---|
62 | </postal> |
---|
63 | <email>jg@laptop.org</email> |
---|
64 | <uri>http://www.laptop.org/</uri> |
---|
65 | </address> |
---|
66 | </author> |
---|
67 | |
---|
68 | <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul"> |
---|
69 | <organization abbrev="HP">Hewlett-Packard Company</organization> |
---|
70 | <address> |
---|
71 | <postal> |
---|
72 | <street>HP Labs, Large Scale Systems Group</street> |
---|
73 | <street>1501 Page Mill Road, MS 1177</street> |
---|
74 | <city>Palo Alto</city> |
---|
75 | <region>CA</region> |
---|
76 | <code>94304</code> |
---|
77 | <country>USA</country> |
---|
78 | </postal> |
---|
79 | <email>JeffMogul@acm.org</email> |
---|
80 | </address> |
---|
81 | </author> |
---|
82 | |
---|
83 | <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen"> |
---|
84 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
85 | <address> |
---|
86 | <postal> |
---|
87 | <street>1 Microsoft Way</street> |
---|
88 | <city>Redmond</city> |
---|
89 | <region>WA</region> |
---|
90 | <code>98052</code> |
---|
91 | <country>USA</country> |
---|
92 | </postal> |
---|
93 | <email>henrikn@microsoft.com</email> |
---|
94 | </address> |
---|
95 | </author> |
---|
96 | |
---|
97 | <author initials="L." surname="Masinter" fullname="Larry Masinter"> |
---|
98 | <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization> |
---|
99 | <address> |
---|
100 | <postal> |
---|
101 | <street>345 Park Ave</street> |
---|
102 | <city>San Jose</city> |
---|
103 | <region>CA</region> |
---|
104 | <code>95110</code> |
---|
105 | <country>USA</country> |
---|
106 | </postal> |
---|
107 | <email>LMM@acm.org</email> |
---|
108 | <uri>http://larry.masinter.net/</uri> |
---|
109 | </address> |
---|
110 | </author> |
---|
111 | |
---|
112 | <author initials="P." surname="Leach" fullname="Paul J. Leach"> |
---|
113 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
114 | <address> |
---|
115 | <postal> |
---|
116 | <street>1 Microsoft Way</street> |
---|
117 | <city>Redmond</city> |
---|
118 | <region>WA</region> |
---|
119 | <code>98052</code> |
---|
120 | </postal> |
---|
121 | <email>paulle@microsoft.com</email> |
---|
122 | </address> |
---|
123 | </author> |
---|
124 | |
---|
125 | <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee"> |
---|
126 | <organization abbrev="W3C/MIT">World Wide Web Consortium</organization> |
---|
127 | <address> |
---|
128 | <postal> |
---|
129 | <street>MIT Computer Science and Artificial Intelligence Laboratory</street> |
---|
130 | <street>The Stata Center, Building 32</street> |
---|
131 | <street>32 Vassar Street</street> |
---|
132 | <city>Cambridge</city> |
---|
133 | <region>MA</region> |
---|
134 | <code>02139</code> |
---|
135 | <country>USA</country> |
---|
136 | </postal> |
---|
137 | <email>timbl@w3.org</email> |
---|
138 | <uri>http://www.w3.org/People/Berners-Lee/</uri> |
---|
139 | </address> |
---|
140 | </author> |
---|
141 | |
---|
142 | <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor"> |
---|
143 | <organization abbrev="W3C">World Wide Web Consortium</organization> |
---|
144 | <address> |
---|
145 | <postal> |
---|
146 | <street>W3C / ERCIM</street> |
---|
147 | <street>2004, rte des Lucioles</street> |
---|
148 | <city>Sophia-Antipolis</city> |
---|
149 | <region>AM</region> |
---|
150 | <code>06902</code> |
---|
151 | <country>France</country> |
---|
152 | </postal> |
---|
153 | <email>ylafon@w3.org</email> |
---|
154 | <uri>http://www.raubacapeu.net/people/yves/</uri> |
---|
155 | </address> |
---|
156 | </author> |
---|
157 | |
---|
158 | <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor"> |
---|
159 | <organization abbrev="greenbytes">greenbytes GmbH</organization> |
---|
160 | <address> |
---|
161 | <postal> |
---|
162 | <street>Hafenweg 16</street> |
---|
163 | <city>Muenster</city><region>NW</region><code>48155</code> |
---|
164 | <country>Germany</country> |
---|
165 | </postal> |
---|
166 | <phone>+49 251 2807760</phone> |
---|
167 | <facsimile>+49 251 2807761</facsimile> |
---|
168 | <email>julian.reschke@greenbytes.de</email> |
---|
169 | <uri>http://greenbytes.de/tech/webdav/</uri> |
---|
170 | </address> |
---|
171 | </author> |
---|
172 | |
---|
173 | <date month="&ID-MONTH;" year="&ID-YEAR;"/> |
---|
174 | |
---|
175 | <abstract> |
---|
176 | <t> |
---|
177 | The Hypertext Transfer Protocol (HTTP) is an application-level |
---|
178 | protocol for distributed, collaborative, hypermedia information |
---|
179 | systems. HTTP has been in use by the World Wide Web global information |
---|
180 | initiative since 1990. This document is Part 5 of the seven-part specification |
---|
181 | that defines the protocol referred to as "HTTP/1.1" and, taken together, |
---|
182 | obsoletes RFC 2616. Part 5 defines range-specific requests and |
---|
183 | the rules for constructing and combining responses to those requests. |
---|
184 | </t> |
---|
185 | </abstract> |
---|
186 | |
---|
187 | <note title="Editorial Note (To be removed by RFC Editor)"> |
---|
188 | <t> |
---|
189 | Discussion of this draft should take place on the HTTPBIS working group |
---|
190 | mailing list (ietf-http-wg@w3.org). The current issues list is |
---|
191 | at <eref target="http://www.tools.ietf.org/wg/httpbis/trac/report/11"/> |
---|
192 | and related documents (including fancy diffs) can be found at |
---|
193 | <eref target="http://www.tools.ietf.org/wg/httpbis/"/>. |
---|
194 | </t> |
---|
195 | </note> |
---|
196 | </front> |
---|
197 | <middle> |
---|
198 | <section title="Introduction" anchor="introduction"> |
---|
199 | <t> |
---|
200 | This document will define aspects of HTTP related to range requests, |
---|
201 | partial responses, and the multipart/byteranges media type. Right now |
---|
202 | it only includes the extracted relevant sections of |
---|
203 | <xref target="RFC2616">RFC 2616</xref> without edit. |
---|
204 | </t> |
---|
205 | |
---|
206 | <section title="Requirements" anchor="intro.requirements"> |
---|
207 | <t> |
---|
208 | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", |
---|
209 | "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this |
---|
210 | document are to be interpreted as described in <xref target="RFC2119"/>. |
---|
211 | </t> |
---|
212 | <t> |
---|
213 | An implementation is not compliant if it fails to satisfy one or more |
---|
214 | of the &MUST; or &REQUIRED; level requirements for the protocols it |
---|
215 | implements. An implementation that satisfies all the &MUST; or &REQUIRED; |
---|
216 | level and all the &SHOULD; level requirements for its protocols is said |
---|
217 | to be "unconditionally compliant"; one that satisfies all the &MUST; |
---|
218 | level requirements but not all the &SHOULD; level requirements for its |
---|
219 | protocols is said to be "conditionally compliant." |
---|
220 | </t> |
---|
221 | </section> |
---|
222 | </section> |
---|
223 | |
---|
224 | <section title="Range Units" anchor="range.units"> |
---|
225 | <t> |
---|
226 | HTTP/1.1 allows a client to request that only part (a range of) the |
---|
227 | response entity be included within the response. HTTP/1.1 uses range |
---|
228 | units in the Range (<xref target="header.range"/>) and Content-Range (<xref target="header.content-range"/>) |
---|
229 | header fields. An entity can be broken down into subranges according |
---|
230 | to various structural units. |
---|
231 | </t> |
---|
232 | <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"/> |
---|
233 | range-unit = bytes-unit | other-range-unit |
---|
234 | bytes-unit = "bytes" |
---|
235 | other-range-unit = token |
---|
236 | </artwork></figure> |
---|
237 | <t> |
---|
238 | The only range unit defined by HTTP/1.1 is "bytes". HTTP/1.1 |
---|
239 | implementations &MAY; ignore ranges specified using other units. |
---|
240 | </t> |
---|
241 | <t> |
---|
242 | HTTP/1.1 has been designed to allow implementations of applications |
---|
243 | that do not depend on knowledge of ranges. |
---|
244 | </t> |
---|
245 | </section> |
---|
246 | |
---|
247 | <section title="Status Code Definitions"> |
---|
248 | <section title="206 Partial Content" anchor="status.206"> |
---|
249 | <iref primary="true" item="206 Partial Content (status code)" x:for-anchor=""/> |
---|
250 | <iref primary="true" item="Status Codes" subitem="206 Partial Content" x:for-anchor=""/> |
---|
251 | <t> |
---|
252 | The server has fulfilled the partial GET request for the resource. |
---|
253 | The request &MUST; have included a Range header field (<xref target="header.range"/>) |
---|
254 | indicating the desired range, and &MAY; have included an If-Range |
---|
255 | header field (<xref target="header.if-range"/>) to make the request conditional. |
---|
256 | </t> |
---|
257 | <t> |
---|
258 | The response &MUST; include the following header fields: |
---|
259 | <list style="symbols"> |
---|
260 | <t> |
---|
261 | Either a Content-Range header field (<xref target="header.content-range"/>) indicating |
---|
262 | the range included with this response, or a multipart/byteranges |
---|
263 | Content-Type including Content-Range fields for each part. If a |
---|
264 | Content-Length header field is present in the response, its |
---|
265 | value &MUST; match the actual number of OCTETs transmitted in the |
---|
266 | message-body. |
---|
267 | </t> |
---|
268 | <t> |
---|
269 | Date |
---|
270 | </t> |
---|
271 | <t> |
---|
272 | ETag and/or Content-Location, if the header would have been sent |
---|
273 | in a 200 response to the same request |
---|
274 | </t> |
---|
275 | <t> |
---|
276 | Expires, Cache-Control, and/or Vary, if the field-value might |
---|
277 | differ from that sent in any previous response for the same |
---|
278 | variant |
---|
279 | </t> |
---|
280 | </list> |
---|
281 | </t> |
---|
282 | <t> |
---|
283 | If the 206 response is the result of an If-Range request, the response |
---|
284 | &SHOULD-NOT; include other entity-headers. Otherwise, the response |
---|
285 | &MUST; include all of the entity-headers that would have been returned |
---|
286 | with a 200 (OK) response to the same request. |
---|
287 | </t> |
---|
288 | <t> |
---|
289 | A cache &MUST-NOT; combine a 206 response with other previously cached |
---|
290 | content if the ETag or Last-Modified headers do not match exactly, |
---|
291 | see <xref target="combining.byte.ranges"/>. |
---|
292 | </t> |
---|
293 | <t> |
---|
294 | A cache that does not support the Range and Content-Range headers |
---|
295 | &MUST-NOT; cache 206 (Partial Content) responses. |
---|
296 | </t> |
---|
297 | </section> |
---|
298 | |
---|
299 | <section title="416 Requested Range Not Satisfiable" anchor="status.416"> |
---|
300 | <iref primary="true" item="416 Requested Range Not Satisfiable (status code)" x:for-anchor=""/> |
---|
301 | <iref primary="true" item="Status Codes" subitem="416 Requested Range Not Satisfiable" x:for-anchor=""/> |
---|
302 | <t> |
---|
303 | A server &SHOULD; return a response with this status code if a request |
---|
304 | included a Range request-header field (<xref target="header.range"/>), and none of |
---|
305 | the range-specifier values in this field overlap the current extent |
---|
306 | of the selected resource, and the request did not include an If-Range |
---|
307 | request-header field. (For byte-ranges, this means that the first-byte-pos |
---|
308 | of all of the byte-range-spec values were greater than the |
---|
309 | current length of the selected resource.) |
---|
310 | </t> |
---|
311 | <t> |
---|
312 | When this status code is returned for a byte-range request, the |
---|
313 | response &SHOULD; include a Content-Range entity-header field |
---|
314 | specifying the current length of the selected resource (see <xref target="header.content-range"/>). |
---|
315 | This response &MUST-NOT; use the multipart/byteranges content-type. |
---|
316 | </t> |
---|
317 | </section> |
---|
318 | </section> |
---|
319 | |
---|
320 | <section title="Combining Byte Ranges" anchor="combining.byte.ranges"> |
---|
321 | <t> |
---|
322 | A response might transfer only a subrange of the bytes of an entity-body, |
---|
323 | either because the request included one or more Range |
---|
324 | specifications, or because a connection was broken prematurely. After |
---|
325 | several such transfers, a cache might have received several ranges of |
---|
326 | the same entity-body. |
---|
327 | </t> |
---|
328 | <t> |
---|
329 | If a cache has a stored non-empty set of subranges for an entity, and |
---|
330 | an incoming response transfers another subrange, the cache &MAY; |
---|
331 | combine the new subrange with the existing set if both the following |
---|
332 | conditions are met: |
---|
333 | <list style="symbols"> |
---|
334 | <t>Both the incoming response and the cache entry have a cache |
---|
335 | validator.</t> |
---|
336 | <t>The two cache validators match using the strong comparison |
---|
337 | function (see &weak-and-strong-validators;).</t> |
---|
338 | </list> |
---|
339 | </t> |
---|
340 | <t> |
---|
341 | If either requirement is not met, the cache &MUST; use only the most |
---|
342 | recent partial response (based on the Date values transmitted with |
---|
343 | every response, and using the incoming response if these values are |
---|
344 | equal or missing), and &MUST; discard the other partial information. |
---|
345 | </t> |
---|
346 | </section> |
---|
347 | |
---|
348 | <section title="Header Field Definitions" anchor="header.fields"> |
---|
349 | <t> |
---|
350 | This section defines the syntax and semantics of HTTP/1.1 header fields |
---|
351 | related to range requests and partial responses. |
---|
352 | </t> |
---|
353 | <t> |
---|
354 | For entity-header fields, both sender and recipient refer to either the |
---|
355 | client or the server, depending on who sends and who receives the entity. |
---|
356 | </t> |
---|
357 | |
---|
358 | <section title="Accept-Ranges" anchor="header.accept-ranges"> |
---|
359 | <iref primary="true" item="Accept-Ranges header" x:for-anchor=""/> |
---|
360 | <iref primary="true" item="Headers" subitem="Accept-Ranges" x:for-anchor=""/> |
---|
361 | <t> |
---|
362 | The Accept-Ranges response-header field allows the server to |
---|
363 | indicate its acceptance of range requests for a resource: |
---|
364 | </t> |
---|
365 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Ranges"/><iref primary="true" item="Grammar" subitem="acceptable-ranges"/> |
---|
366 | Accept-Ranges = "Accept-Ranges" ":" acceptable-ranges |
---|
367 | acceptable-ranges = 1#range-unit | "none" |
---|
368 | </artwork></figure> |
---|
369 | <t> |
---|
370 | Origin servers that accept byte-range requests &MAY; send |
---|
371 | </t> |
---|
372 | <figure><artwork type="example"> |
---|
373 | Accept-Ranges: bytes |
---|
374 | </artwork></figure> |
---|
375 | <t> |
---|
376 | but are not required to do so. Clients &MAY; generate byte-range |
---|
377 | requests without having received this header for the resource |
---|
378 | involved. Range units are defined in <xref target="range.units"/>. |
---|
379 | </t> |
---|
380 | <t> |
---|
381 | Servers that do not accept any kind of range request for a |
---|
382 | resource &MAY; send |
---|
383 | </t> |
---|
384 | <figure><artwork type="example"> |
---|
385 | Accept-Ranges: none |
---|
386 | </artwork></figure> |
---|
387 | <t> |
---|
388 | to advise the client not to attempt a range request. |
---|
389 | </t> |
---|
390 | </section> |
---|
391 | |
---|
392 | <section title="Content-Range" anchor="header.content-range"> |
---|
393 | <iref primary="true" item="Content-Range header" x:for-anchor=""/> |
---|
394 | <iref primary="true" item="Headers" subitem="Content-Range" x:for-anchor=""/> |
---|
395 | <t> |
---|
396 | The Content-Range entity-header is sent with a partial entity-body to |
---|
397 | specify where in the full entity-body the partial body should be |
---|
398 | applied. Range units are defined in <xref target="range.units"/>. |
---|
399 | </t> |
---|
400 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Range"/><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"/> |
---|
401 | Content-Range = "Content-Range" ":" content-range-spec |
---|
402 | |
---|
403 | content-range-spec = byte-content-range-spec |
---|
404 | byte-content-range-spec = bytes-unit SP |
---|
405 | byte-range-resp-spec "/" |
---|
406 | ( instance-length | "*" ) |
---|
407 | |
---|
408 | byte-range-resp-spec = (first-byte-pos "-" last-byte-pos) |
---|
409 | | "*" |
---|
410 | instance-length = 1*DIGIT |
---|
411 | </artwork></figure> |
---|
412 | <t> |
---|
413 | The header &SHOULD; indicate the total length of the full entity-body, |
---|
414 | unless this length is unknown or difficult to determine. The asterisk |
---|
415 | "*" character means that the instance-length is unknown at the time |
---|
416 | when the response was generated. |
---|
417 | </t> |
---|
418 | <t> |
---|
419 | Unlike byte-ranges-specifier values (see <xref target="byte.ranges"/>), a byte-range-resp-spec |
---|
420 | &MUST; only specify one range, and &MUST; contain |
---|
421 | absolute byte positions for both the first and last byte of the |
---|
422 | range. |
---|
423 | </t> |
---|
424 | <t> |
---|
425 | A byte-content-range-spec with a byte-range-resp-spec whose last-byte-pos |
---|
426 | value is less than its first-byte-pos value, or whose |
---|
427 | instance-length value is less than or equal to its last-byte-pos |
---|
428 | value, is invalid. The recipient of an invalid byte-content-range-spec |
---|
429 | &MUST; ignore it and any content transferred along with it. |
---|
430 | </t> |
---|
431 | <t> |
---|
432 | A server sending a response with status code 416 (Requested range not |
---|
433 | satisfiable) &SHOULD; include a Content-Range field with a byte-range-resp-spec |
---|
434 | of "*". The instance-length specifies the current length of |
---|
435 | the selected resource. A response with status code 206 (Partial |
---|
436 | Content) &MUST-NOT; include a Content-Range field with a byte-range-resp-spec of "*". |
---|
437 | </t> |
---|
438 | <t> |
---|
439 | Examples of byte-content-range-spec values, assuming that the entity |
---|
440 | contains a total of 1234 bytes: |
---|
441 | <list style="symbols"> |
---|
442 | <t> |
---|
443 | The first 500 bytes: |
---|
444 | <figure><artwork type="text/plain"> |
---|
445 | bytes 0-499/1234 |
---|
446 | </artwork></figure> |
---|
447 | </t> |
---|
448 | <t> |
---|
449 | The second 500 bytes: |
---|
450 | <figure><artwork type="text/plain"> |
---|
451 | bytes 500-999/1234 |
---|
452 | </artwork></figure> |
---|
453 | </t> |
---|
454 | <t> |
---|
455 | All except for the first 500 bytes: |
---|
456 | <figure><artwork type="text/plain"> |
---|
457 | bytes 500-1233/1234 |
---|
458 | </artwork></figure> |
---|
459 | </t> |
---|
460 | <t> |
---|
461 | The last 500 bytes: |
---|
462 | <figure><artwork type="text/plain"> |
---|
463 | bytes 734-1233/1234 |
---|
464 | </artwork></figure> |
---|
465 | </t> |
---|
466 | </list> |
---|
467 | </t> |
---|
468 | <t> |
---|
469 | When an HTTP message includes the content of a single range (for |
---|
470 | example, a response to a request for a single range, or to a request |
---|
471 | for a set of ranges that overlap without any holes), this content is |
---|
472 | transmitted with a Content-Range header, and a Content-Length header |
---|
473 | showing the number of bytes actually transferred. For example, |
---|
474 | </t> |
---|
475 | <figure><artwork type="example"> |
---|
476 | HTTP/1.1 206 Partial Content |
---|
477 | Date: Wed, 15 Nov 1995 06:25:24 GMT |
---|
478 | Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT |
---|
479 | Content-Range: bytes 21010-47021/47022 |
---|
480 | Content-Length: 26012 |
---|
481 | Content-Type: image/gif |
---|
482 | </artwork></figure> |
---|
483 | <t> |
---|
484 | When an HTTP message includes the content of multiple ranges (for |
---|
485 | example, a response to a request for multiple non-overlapping |
---|
486 | ranges), these are transmitted as a multipart message. The multipart |
---|
487 | media type used for this purpose is "multipart/byteranges" as defined |
---|
488 | in <xref target="internet.media.type.multipart.byteranges"/>. See <xref target="changes.from.rfc.2068"/> for a compatibility issue. |
---|
489 | </t> |
---|
490 | <t> |
---|
491 | A response to a request for a single range &MUST-NOT; be sent using the |
---|
492 | multipart/byteranges media type. A response to a request for |
---|
493 | multiple ranges, whose result is a single range, &MAY; be sent as a |
---|
494 | multipart/byteranges media type with one part. A client that cannot |
---|
495 | decode a multipart/byteranges message &MUST-NOT; ask for multiple |
---|
496 | byte-ranges in a single request. |
---|
497 | </t> |
---|
498 | <t> |
---|
499 | When a client requests multiple byte-ranges in one request, the |
---|
500 | server &SHOULD; return them in the order that they appeared in the |
---|
501 | request. |
---|
502 | </t> |
---|
503 | <t> |
---|
504 | If the server ignores a byte-range-spec because it is syntactically |
---|
505 | invalid, the server &SHOULD; treat the request as if the invalid Range |
---|
506 | header field did not exist. (Normally, this means return a 200 |
---|
507 | response containing the full entity). |
---|
508 | </t> |
---|
509 | <t> |
---|
510 | If the server receives a request (other than one including an If-Range |
---|
511 | request-header field) with an unsatisfiable Range request-header |
---|
512 | field (that is, all of whose byte-range-spec values have a |
---|
513 | first-byte-pos value greater than the current length of the selected |
---|
514 | resource), it &SHOULD; return a response code of 416 (Requested range |
---|
515 | not satisfiable) (<xref target="status.416"/>). |
---|
516 | <list><t> |
---|
517 | <x:h>Note:</x:h> clients cannot depend on servers to send a 416 (Requested |
---|
518 | range not satisfiable) response instead of a 200 (OK) response for |
---|
519 | an unsatisfiable Range request-header, since not all servers |
---|
520 | implement this request-header. |
---|
521 | </t></list> |
---|
522 | </t> |
---|
523 | </section> |
---|
524 | |
---|
525 | <section title="If-Range" anchor="header.if-range"> |
---|
526 | <iref primary="true" item="If-Range header" x:for-anchor=""/> |
---|
527 | <iref primary="true" item="Headers" subitem="If-Range" x:for-anchor=""/> |
---|
528 | <t> |
---|
529 | If a client has a partial copy of an entity in its cache, and wishes |
---|
530 | to have an up-to-date copy of the entire entity in its cache, it |
---|
531 | could use the Range request-header with a conditional GET (using |
---|
532 | either or both of If-Unmodified-Since and If-Match.) However, if the |
---|
533 | condition fails because the entity has been modified, the client |
---|
534 | would then have to make a second request to obtain the entire current |
---|
535 | entity-body. |
---|
536 | </t> |
---|
537 | <t> |
---|
538 | The If-Range header allows a client to "short-circuit" the second |
---|
539 | request. Informally, its meaning is `if the entity is unchanged, send |
---|
540 | me the part(s) that I am missing; otherwise, send me the entire new |
---|
541 | entity'. |
---|
542 | </t> |
---|
543 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Range"/> |
---|
544 | If-Range = "If-Range" ":" ( entity-tag | HTTP-date ) |
---|
545 | </artwork></figure> |
---|
546 | <t> |
---|
547 | If the client has no entity tag for an entity, but does have a Last-Modified |
---|
548 | date, it &MAY; use that date in an If-Range header. (The |
---|
549 | server can distinguish between a valid HTTP-date and any form of |
---|
550 | entity-tag by examining no more than two characters.) The If-Range |
---|
551 | header &SHOULD; only be used together with a Range header, and &MUST; be |
---|
552 | ignored if the request does not include a Range header, or if the |
---|
553 | server does not support the sub-range operation. |
---|
554 | </t> |
---|
555 | <t> |
---|
556 | If the entity tag given in the If-Range header matches the current |
---|
557 | entity tag for the entity, then the server &SHOULD; provide the |
---|
558 | specified sub-range of the entity using a 206 (Partial Content) |
---|
559 | response. If the entity tag does not match, then the server &SHOULD; |
---|
560 | return the entire entity using a 200 (OK) response. |
---|
561 | </t> |
---|
562 | </section> |
---|
563 | |
---|
564 | <section title="Range" anchor="header.range"> |
---|
565 | <iref primary="true" item="Range header" x:for-anchor=""/> |
---|
566 | <iref primary="true" item="Headers" subitem="Range" x:for-anchor=""/> |
---|
567 | |
---|
568 | <section title="Byte Ranges" anchor="byte.ranges"> |
---|
569 | <t> |
---|
570 | Since all HTTP entities are represented in HTTP messages as sequences |
---|
571 | of bytes, the concept of a byte range is meaningful for any HTTP |
---|
572 | entity. (However, not all clients and servers need to support byte-range |
---|
573 | operations.) |
---|
574 | </t> |
---|
575 | <t> |
---|
576 | Byte range specifications in HTTP apply to the sequence of bytes in |
---|
577 | the entity-body (not necessarily the same as the message-body). |
---|
578 | </t> |
---|
579 | <t> |
---|
580 | A byte range operation &MAY; specify a single range of bytes, or a set |
---|
581 | of ranges within a single entity. |
---|
582 | </t> |
---|
583 | <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"/> |
---|
584 | ranges-specifier = byte-ranges-specifier |
---|
585 | byte-ranges-specifier = bytes-unit "=" byte-range-set |
---|
586 | byte-range-set = 1#( byte-range-spec | suffix-byte-range-spec ) |
---|
587 | byte-range-spec = first-byte-pos "-" [last-byte-pos] |
---|
588 | first-byte-pos = 1*DIGIT |
---|
589 | last-byte-pos = 1*DIGIT |
---|
590 | </artwork></figure> |
---|
591 | <t> |
---|
592 | The first-byte-pos value in a byte-range-spec gives the byte-offset |
---|
593 | of the first byte in a range. The last-byte-pos value gives the |
---|
594 | byte-offset of the last byte in the range; that is, the byte |
---|
595 | positions specified are inclusive. Byte offsets start at zero. |
---|
596 | </t> |
---|
597 | <t> |
---|
598 | If the last-byte-pos value is present, it &MUST; be greater than or |
---|
599 | equal to the first-byte-pos in that byte-range-spec, or the byte-range-spec |
---|
600 | is syntactically invalid. The recipient of a byte-range-set |
---|
601 | that includes one or more syntactically invalid byte-range-spec |
---|
602 | values &MUST; ignore the header field that includes that byte-range-set. |
---|
603 | </t> |
---|
604 | <t> |
---|
605 | If the last-byte-pos value is absent, or if the value is greater than |
---|
606 | or equal to the current length of the entity-body, last-byte-pos is |
---|
607 | taken to be equal to one less than the current length of the entity-body |
---|
608 | in bytes. |
---|
609 | </t> |
---|
610 | <t> |
---|
611 | By its choice of last-byte-pos, a client can limit the number of |
---|
612 | bytes retrieved without knowing the size of the entity. |
---|
613 | </t> |
---|
614 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="suffix-byte-range-spec"/><iref primary="true" item="Grammar" subitem="suffix-length"/> |
---|
615 | suffix-byte-range-spec = "-" suffix-length |
---|
616 | suffix-length = 1*DIGIT |
---|
617 | </artwork></figure> |
---|
618 | <t> |
---|
619 | A suffix-byte-range-spec is used to specify the suffix of the |
---|
620 | entity-body, of a length given by the suffix-length value. (That is, |
---|
621 | this form specifies the last N bytes of an entity-body.) If the |
---|
622 | entity is shorter than the specified suffix-length, the entire |
---|
623 | entity-body is used. |
---|
624 | </t> |
---|
625 | <t> |
---|
626 | If a syntactically valid byte-range-set includes at least one byte-range-spec |
---|
627 | whose first-byte-pos is less than the current length of |
---|
628 | the entity-body, or at least one suffix-byte-range-spec with a non-zero |
---|
629 | suffix-length, then the byte-range-set is satisfiable. |
---|
630 | Otherwise, the byte-range-set is unsatisfiable. If the byte-range-set |
---|
631 | is unsatisfiable, the server &SHOULD; return a response with a status |
---|
632 | of 416 (Requested range not satisfiable). Otherwise, the server |
---|
633 | &SHOULD; return a response with a status of 206 (Partial Content) |
---|
634 | containing the satisfiable ranges of the entity-body. |
---|
635 | </t> |
---|
636 | <t> |
---|
637 | Examples of byte-ranges-specifier values (assuming an entity-body of |
---|
638 | length 10000): |
---|
639 | <list style="symbols"> |
---|
640 | <t>The first 500 bytes (byte offsets 0-499, inclusive): bytes=0-499</t> |
---|
641 | |
---|
642 | <t>The second 500 bytes (byte offsets 500-999, inclusive): |
---|
643 | bytes=500-999</t> |
---|
644 | |
---|
645 | <t>The final 500 bytes (byte offsets 9500-9999, inclusive): |
---|
646 | bytes=-500</t> |
---|
647 | |
---|
648 | <t>Or bytes=9500-</t> |
---|
649 | |
---|
650 | <t>The first and last bytes only (bytes 0 and 9999): bytes=0-0,-1</t> |
---|
651 | |
---|
652 | <t>Several legal but not canonical specifications of the second 500 |
---|
653 | bytes (byte offsets 500-999, inclusive): |
---|
654 | <vspace/> |
---|
655 | bytes=500-600,601-999<vspace/> |
---|
656 | bytes=500-700,601-999</t> |
---|
657 | </list> |
---|
658 | </t> |
---|
659 | </section> |
---|
660 | |
---|
661 | <section title="Range Retrieval Requests" anchor="range.retrieval.requests"> |
---|
662 | <t> |
---|
663 | HTTP retrieval requests using conditional or unconditional GET |
---|
664 | methods &MAY; request one or more sub-ranges of the entity, instead of |
---|
665 | the entire entity, using the Range request header, which applies to |
---|
666 | the entity returned as the result of the request: |
---|
667 | </t> |
---|
668 | <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Range"/> |
---|
669 | Range = "Range" ":" ranges-specifier |
---|
670 | </artwork></figure> |
---|
671 | <t> |
---|
672 | A server &MAY; ignore the Range header. However, HTTP/1.1 origin |
---|
673 | servers and intermediate caches ought to support byte ranges when |
---|
674 | possible, since Range supports efficient recovery from partially |
---|
675 | failed transfers, and supports efficient partial retrieval of large |
---|
676 | entities. |
---|
677 | </t> |
---|
678 | <t> |
---|
679 | If the server supports the Range header and the specified range or |
---|
680 | ranges are appropriate for the entity: |
---|
681 | <list style="symbols"> |
---|
682 | <t>The presence of a Range header in an unconditional GET modifies |
---|
683 | what is returned if the GET is otherwise successful. In other |
---|
684 | words, the response carries a status code of 206 (Partial |
---|
685 | Content) instead of 200 (OK).</t> |
---|
686 | |
---|
687 | <t>The presence of a Range header in a conditional GET (a request |
---|
688 | using one or both of If-Modified-Since and If-None-Match, or |
---|
689 | one or both of If-Unmodified-Since and If-Match) modifies what |
---|
690 | is returned if the GET is otherwise successful and the |
---|
691 | condition is true. It does not affect the 304 (Not Modified) |
---|
692 | response returned if the conditional is false.</t> |
---|
693 | </list> |
---|
694 | </t> |
---|
695 | <t> |
---|
696 | In some cases, it might be more appropriate to use the If-Range |
---|
697 | header (see <xref target="header.if-range"/>) in addition to the Range header. |
---|
698 | </t> |
---|
699 | <t> |
---|
700 | If a proxy that supports ranges receives a Range request, forwards |
---|
701 | the request to an inbound server, and receives an entire entity in |
---|
702 | reply, it &SHOULD; only return the requested range to its client. It |
---|
703 | &SHOULD; store the entire received response in its cache if that is |
---|
704 | consistent with its cache allocation policies. |
---|
705 | </t> |
---|
706 | </section> |
---|
707 | </section> |
---|
708 | </section> |
---|
709 | |
---|
710 | <section title="IANA Considerations" anchor="IANA.considerations"> |
---|
711 | <t> |
---|
712 | TBD. |
---|
713 | </t> |
---|
714 | </section> |
---|
715 | |
---|
716 | <section title="Security Considerations" anchor="security.considerations"> |
---|
717 | <t> |
---|
718 | No additional security considerations have been identified beyond |
---|
719 | those applicable to HTTP in general &messaging;. |
---|
720 | </t> |
---|
721 | </section> |
---|
722 | |
---|
723 | <section title="Acknowledgments" anchor="ack"> |
---|
724 | <t> |
---|
725 | Most of the specification of ranges is based on work originally done |
---|
726 | by Ari Luotonen and John Franks, with additional input from Steve |
---|
727 | Zilles. |
---|
728 | </t> |
---|
729 | </section> |
---|
730 | </middle> |
---|
731 | <back> |
---|
732 | |
---|
733 | <references title="Normative References"> |
---|
734 | |
---|
735 | <reference anchor="Part1"> |
---|
736 | <front> |
---|
737 | <title abbrev="HTTP/1.1">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</title> |
---|
738 | <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor"> |
---|
739 | <organization abbrev="Day Software">Day Software</organization> |
---|
740 | <address><email>fielding@gbiv.com</email></address> |
---|
741 | </author> |
---|
742 | <author initials="J." surname="Gettys" fullname="Jim Gettys"> |
---|
743 | <organization>One Laptop per Child</organization> |
---|
744 | <address><email>jg@laptop.org</email></address> |
---|
745 | </author> |
---|
746 | <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul"> |
---|
747 | <organization abbrev="HP">Hewlett-Packard Company</organization> |
---|
748 | <address><email>JeffMogul@acm.org</email></address> |
---|
749 | </author> |
---|
750 | <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen"> |
---|
751 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
752 | <address><email>henrikn@microsoft.com</email></address> |
---|
753 | </author> |
---|
754 | <author initials="L." surname="Masinter" fullname="Larry Masinter"> |
---|
755 | <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization> |
---|
756 | <address><email>LMM@acm.org</email></address> |
---|
757 | </author> |
---|
758 | <author initials="P." surname="Leach" fullname="Paul J. Leach"> |
---|
759 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
760 | <address><email>paulle@microsoft.com</email></address> |
---|
761 | </author> |
---|
762 | <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee"> |
---|
763 | <organization abbrev="W3C/MIT">World Wide Web Consortium</organization> |
---|
764 | <address><email>timbl@w3.org</email></address> |
---|
765 | </author> |
---|
766 | <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor"> |
---|
767 | <organization abbrev="W3C">World Wide Web Consortium</organization> |
---|
768 | <address><email>ylafon@w3.org</email></address> |
---|
769 | </author> |
---|
770 | <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor"> |
---|
771 | <organization abbrev="greenbytes">greenbytes GmbH</organization> |
---|
772 | <address><email>julian.reschke@greenbytes.de</email></address> |
---|
773 | </author> |
---|
774 | <date month="&ID-MONTH;" year="&ID-YEAR;"/> |
---|
775 | </front> |
---|
776 | <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"/> |
---|
777 | <x:source href="p1-messaging.xml" basename="p1-messaging"/> |
---|
778 | </reference> |
---|
779 | |
---|
780 | <reference anchor="Part3"> |
---|
781 | <front> |
---|
782 | <title abbrev="HTTP/1.1">HTTP/1.1, part 3: Message Payload and Content Negotiation</title> |
---|
783 | <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor"> |
---|
784 | <organization abbrev="Day Software">Day Software</organization> |
---|
785 | <address><email>fielding@gbiv.com</email></address> |
---|
786 | </author> |
---|
787 | <author initials="J." surname="Gettys" fullname="Jim Gettys"> |
---|
788 | <organization>One Laptop per Child</organization> |
---|
789 | <address><email>jg@laptop.org</email></address> |
---|
790 | </author> |
---|
791 | <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul"> |
---|
792 | <organization abbrev="HP">Hewlett-Packard Company</organization> |
---|
793 | <address><email>JeffMogul@acm.org</email></address> |
---|
794 | </author> |
---|
795 | <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen"> |
---|
796 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
797 | <address><email>henrikn@microsoft.com</email></address> |
---|
798 | </author> |
---|
799 | <author initials="L." surname="Masinter" fullname="Larry Masinter"> |
---|
800 | <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization> |
---|
801 | <address><email>LMM@acm.org</email></address> |
---|
802 | </author> |
---|
803 | <author initials="P." surname="Leach" fullname="Paul J. Leach"> |
---|
804 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
805 | <address><email>paulle@microsoft.com</email></address> |
---|
806 | </author> |
---|
807 | <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee"> |
---|
808 | <organization abbrev="W3C/MIT">World Wide Web Consortium</organization> |
---|
809 | <address><email>timbl@w3.org</email></address> |
---|
810 | </author> |
---|
811 | <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor"> |
---|
812 | <organization abbrev="W3C">World Wide Web Consortium</organization> |
---|
813 | <address><email>ylafon@w3.org</email></address> |
---|
814 | </author> |
---|
815 | <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor"> |
---|
816 | <organization abbrev="greenbytes">greenbytes GmbH</organization> |
---|
817 | <address><email>julian.reschke@greenbytes.de</email></address> |
---|
818 | </author> |
---|
819 | <date month="&ID-MONTH;" year="&ID-YEAR;"/> |
---|
820 | </front> |
---|
821 | <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p3-payload-&ID-VERSION;"/> |
---|
822 | <x:source href="p3-payload.xml" basename="p3-payload"/> |
---|
823 | </reference> |
---|
824 | |
---|
825 | <reference anchor="Part4"> |
---|
826 | <front> |
---|
827 | <title abbrev="HTTP/1.1">HTTP/1.1, part 4: Conditional Requests</title> |
---|
828 | <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor"> |
---|
829 | <organization abbrev="Day Software">Day Software</organization> |
---|
830 | <address><email>fielding@gbiv.com</email></address> |
---|
831 | </author> |
---|
832 | <author initials="J." surname="Gettys" fullname="Jim Gettys"> |
---|
833 | <organization>One Laptop per Child</organization> |
---|
834 | <address><email>jg@laptop.org</email></address> |
---|
835 | </author> |
---|
836 | <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul"> |
---|
837 | <organization abbrev="HP">Hewlett-Packard Company</organization> |
---|
838 | <address><email>JeffMogul@acm.org</email></address> |
---|
839 | </author> |
---|
840 | <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen"> |
---|
841 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
842 | <address><email>henrikn@microsoft.com</email></address> |
---|
843 | </author> |
---|
844 | <author initials="L." surname="Masinter" fullname="Larry Masinter"> |
---|
845 | <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization> |
---|
846 | <address><email>LMM@acm.org</email></address> |
---|
847 | </author> |
---|
848 | <author initials="P." surname="Leach" fullname="Paul J. Leach"> |
---|
849 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
850 | <address><email>paulle@microsoft.com</email></address> |
---|
851 | </author> |
---|
852 | <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee"> |
---|
853 | <organization abbrev="W3C/MIT">World Wide Web Consortium</organization> |
---|
854 | <address><email>timbl@w3.org</email></address> |
---|
855 | </author> |
---|
856 | <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor"> |
---|
857 | <organization abbrev="W3C">World Wide Web Consortium</organization> |
---|
858 | <address><email>ylafon@w3.org</email></address> |
---|
859 | </author> |
---|
860 | <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor"> |
---|
861 | <organization abbrev="greenbytes">greenbytes GmbH</organization> |
---|
862 | <address><email>julian.reschke@greenbytes.de</email></address> |
---|
863 | </author> |
---|
864 | <date month="&ID-MONTH;" year="&ID-YEAR;"/> |
---|
865 | </front> |
---|
866 | <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p4-conditional-&ID-VERSION;"/> |
---|
867 | <x:source href="p4-conditional.xml" basename="p4-conditional"/> |
---|
868 | </reference> |
---|
869 | |
---|
870 | <reference anchor="Part6"> |
---|
871 | <front> |
---|
872 | <title abbrev="HTTP/1.1">HTTP/1.1, part 6: Caching</title> |
---|
873 | <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor"> |
---|
874 | <organization abbrev="Day Software">Day Software</organization> |
---|
875 | <address><email>fielding@gbiv.com</email></address> |
---|
876 | </author> |
---|
877 | <author initials="J." surname="Gettys" fullname="Jim Gettys"> |
---|
878 | <organization>One Laptop per Child</organization> |
---|
879 | <address><email>jg@laptop.org</email></address> |
---|
880 | </author> |
---|
881 | <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul"> |
---|
882 | <organization abbrev="HP">Hewlett-Packard Company</organization> |
---|
883 | <address><email>JeffMogul@acm.org</email></address> |
---|
884 | </author> |
---|
885 | <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen"> |
---|
886 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
887 | <address><email>henrikn@microsoft.com</email></address> |
---|
888 | </author> |
---|
889 | <author initials="L." surname="Masinter" fullname="Larry Masinter"> |
---|
890 | <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization> |
---|
891 | <address><email>LMM@acm.org</email></address> |
---|
892 | </author> |
---|
893 | <author initials="P." surname="Leach" fullname="Paul J. Leach"> |
---|
894 | <organization abbrev="Microsoft">Microsoft Corporation</organization> |
---|
895 | <address><email>paulle@microsoft.com</email></address> |
---|
896 | </author> |
---|
897 | <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee"> |
---|
898 | <organization abbrev="W3C/MIT">World Wide Web Consortium</organization> |
---|
899 | <address><email>timbl@w3.org</email></address> |
---|
900 | </author> |
---|
901 | <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor"> |
---|
902 | <organization abbrev="W3C">World Wide Web Consortium</organization> |
---|
903 | <address><email>ylafon@w3.org</email></address> |
---|
904 | </author> |
---|
905 | <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor"> |
---|
906 | <organization abbrev="greenbytes">greenbytes GmbH</organization> |
---|
907 | <address><email>julian.reschke@greenbytes.de</email></address> |
---|
908 | </author> |
---|
909 | <date month="&ID-MONTH;" year="&ID-YEAR;"/> |
---|
910 | </front> |
---|
911 | <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-&ID-VERSION;"/> |
---|
912 | <x:source href="p6-cache.xml" basename="p6-cache"/> |
---|
913 | </reference> |
---|
914 | |
---|
915 | <reference anchor="RFC2046"> |
---|
916 | <front> |
---|
917 | <title abbrev="Media Types">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</title> |
---|
918 | <author initials="N." surname="Freed" fullname="Ned Freed"> |
---|
919 | <organization>Innosoft International, Inc.</organization> |
---|
920 | <address><email>ned@innosoft.com</email></address> |
---|
921 | </author> |
---|
922 | <author initials="N." surname="Borenstein" fullname="Nathaniel S. Borenstein"> |
---|
923 | <organization>First Virtual Holdings</organization> |
---|
924 | <address><email>nsb@nsb.fv.com</email></address> |
---|
925 | </author> |
---|
926 | <date month="November" year="1996"/> |
---|
927 | </front> |
---|
928 | <seriesInfo name="RFC" value="2046"/> |
---|
929 | </reference> |
---|
930 | |
---|
931 | <reference anchor="RFC2119"> |
---|
932 | <front> |
---|
933 | <title>Key words for use in RFCs to Indicate Requirement Levels</title> |
---|
934 | <author initials="S." surname="Bradner" fullname="Scott Bradner"> |
---|
935 | <organization>Harvard University</organization> |
---|
936 | <address><email>sob@harvard.edu</email></address> |
---|
937 | </author> |
---|
938 | <date month="March" year="1997"/> |
---|
939 | </front> |
---|
940 | <seriesInfo name="BCP" value="14"/> |
---|
941 | <seriesInfo name="RFC" value="2119"/> |
---|
942 | </reference> |
---|
943 | |
---|
944 | </references> |
---|
945 | |
---|
946 | <references title="Informative References"> |
---|
947 | |
---|
948 | <reference anchor="RFC2616"> |
---|
949 | <front> |
---|
950 | <title>Hypertext Transfer Protocol -- HTTP/1.1</title> |
---|
951 | <author initials="R." surname="Fielding" fullname="R. Fielding"> |
---|
952 | <organization>University of California, Irvine</organization> |
---|
953 | <address><email>fielding@ics.uci.edu</email></address> |
---|
954 | </author> |
---|
955 | <author initials="J." surname="Gettys" fullname="J. Gettys"> |
---|
956 | <organization>W3C</organization> |
---|
957 | <address><email>jg@w3.org</email></address> |
---|
958 | </author> |
---|
959 | <author initials="J." surname="Mogul" fullname="J. Mogul"> |
---|
960 | <organization>Compaq Computer Corporation</organization> |
---|
961 | <address><email>mogul@wrl.dec.com</email></address> |
---|
962 | </author> |
---|
963 | <author initials="H." surname="Frystyk" fullname="H. Frystyk"> |
---|
964 | <organization>MIT Laboratory for Computer Science</organization> |
---|
965 | <address><email>frystyk@w3.org</email></address> |
---|
966 | </author> |
---|
967 | <author initials="L." surname="Masinter" fullname="L. Masinter"> |
---|
968 | <organization>Xerox Corporation</organization> |
---|
969 | <address><email>masinter@parc.xerox.com</email></address> |
---|
970 | </author> |
---|
971 | <author initials="P." surname="Leach" fullname="P. Leach"> |
---|
972 | <organization>Microsoft Corporation</organization> |
---|
973 | <address><email>paulle@microsoft.com</email></address> |
---|
974 | </author> |
---|
975 | <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee"> |
---|
976 | <organization>W3C</organization> |
---|
977 | <address><email>timbl@w3.org</email></address> |
---|
978 | </author> |
---|
979 | <date month="June" year="1999"/> |
---|
980 | </front> |
---|
981 | <seriesInfo name="RFC" value="2616"/> |
---|
982 | </reference> |
---|
983 | |
---|
984 | </references> |
---|
985 | |
---|
986 | <section title="Internet Media Type multipart/byteranges" anchor="internet.media.type.multipart.byteranges"> |
---|
987 | <iref item="Media Type" subitem="multipart/byteranges" primary="true"/> |
---|
988 | <iref item="multipart/byteranges Media Type" primary="true"/> |
---|
989 | <t> |
---|
990 | When an HTTP 206 (Partial Content) response message includes the |
---|
991 | content of multiple ranges (a response to a request for multiple |
---|
992 | non-overlapping ranges), these are transmitted as a multipart |
---|
993 | message-body. The media type for this purpose is called |
---|
994 | "multipart/byteranges". |
---|
995 | </t><t> |
---|
996 | The multipart/byteranges media type includes two or more parts, each |
---|
997 | with its own Content-Type and Content-Range fields. The required |
---|
998 | boundary parameter specifies the boundary string used to separate |
---|
999 | each body-part. |
---|
1000 | </t> |
---|
1001 | <t> |
---|
1002 | <list style="hanging" x:indent="12em"> |
---|
1003 | <t hangText="Media Type name:"> |
---|
1004 | multipart |
---|
1005 | </t> |
---|
1006 | <t hangText="Media subtype name:"> |
---|
1007 | byteranges |
---|
1008 | </t> |
---|
1009 | <t hangText="Required parameters:"> |
---|
1010 | boundary |
---|
1011 | </t> |
---|
1012 | <t hangText="Optional parameters:"> |
---|
1013 | none |
---|
1014 | </t> |
---|
1015 | <t hangText="Encoding considerations:"> |
---|
1016 | only "7bit", "8bit", or "binary" are permitted |
---|
1017 | </t> |
---|
1018 | <t hangText="Security considerations:"> |
---|
1019 | none |
---|
1020 | </t> |
---|
1021 | </list> |
---|
1022 | </t> |
---|
1023 | <figure><preamble> |
---|
1024 | For example: |
---|
1025 | </preamble><artwork type="example"> |
---|
1026 | HTTP/1.1 206 Partial Content |
---|
1027 | Date: Wed, 15 Nov 1995 06:25:24 GMT |
---|
1028 | Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT |
---|
1029 | Content-type: multipart/byteranges; boundary=THIS_STRING_SEPARATES |
---|
1030 | |
---|
1031 | --THIS_STRING_SEPARATES |
---|
1032 | Content-type: application/pdf |
---|
1033 | Content-range: bytes 500-999/8000 |
---|
1034 | |
---|
1035 | ...the first range... |
---|
1036 | --THIS_STRING_SEPARATES |
---|
1037 | Content-type: application/pdf |
---|
1038 | Content-range: bytes 7000-7999/8000 |
---|
1039 | |
---|
1040 | ...the second range |
---|
1041 | --THIS_STRING_SEPARATES-- |
---|
1042 | </artwork></figure> |
---|
1043 | <t> |
---|
1044 | Notes: |
---|
1045 | <list style="numbers"> |
---|
1046 | <t>Additional CRLFs may precede the first boundary string in the |
---|
1047 | entity.</t> |
---|
1048 | |
---|
1049 | <t>Although <xref target="RFC2046"/> permits the boundary string to be |
---|
1050 | quoted, some existing implementations handle a quoted boundary |
---|
1051 | string incorrectly.</t> |
---|
1052 | |
---|
1053 | <t>A number of browsers and servers were coded to an early draft |
---|
1054 | of the byteranges specification to use a media type of |
---|
1055 | multipart/x-byteranges<iref item="multipart/x-byteranges Media Type"/><iref item="Media Type" subitem="multipart/x-byteranges"/>, which is almost, but not quite |
---|
1056 | compatible with the version documented in HTTP/1.1.</t> |
---|
1057 | </list> |
---|
1058 | </t> |
---|
1059 | </section> |
---|
1060 | |
---|
1061 | <section title="Compatibility with Previous Versions" anchor="compatibility"> |
---|
1062 | <section title="Changes from RFC 2068" anchor="changes.from.rfc.2068"> |
---|
1063 | <t> |
---|
1064 | Transfer-coding and message lengths all interact in ways that |
---|
1065 | required fixing exactly when chunked encoding is used (to allow for |
---|
1066 | transfer encoding that may not be self delimiting); it was important |
---|
1067 | to straighten out exactly how message lengths are computed. |
---|
1068 | (<xref target="header.content-range"/>, |
---|
1069 | see also <xref target="Part1"/>, <xref target="Part3"/> and <xref target="Part6"/>) |
---|
1070 | </t> |
---|
1071 | <t> |
---|
1072 | There are situations where a server (especially a proxy) does not |
---|
1073 | know the full length of a response but is capable of serving a |
---|
1074 | byterange request. We therefore need a mechanism to allow byteranges |
---|
1075 | with a content-range not indicating the full length of the message. |
---|
1076 | (<xref target="header.content-range"/>) |
---|
1077 | </t> |
---|
1078 | <t> |
---|
1079 | Range request responses would become very verbose if all meta-data |
---|
1080 | were always returned; by allowing the server to only send needed |
---|
1081 | headers in a 206 response, this problem can be avoided. |
---|
1082 | (Section <xref target="status.206" format="counter"/> |
---|
1083 | and <xref target="header.if-range" format="counter"/>) |
---|
1084 | </t> |
---|
1085 | <t> |
---|
1086 | Fix problem with unsatisfiable range requests; there are two cases: |
---|
1087 | syntactic problems, and range doesn't exist in the document. The 416 |
---|
1088 | status code was needed to resolve this ambiguity needed to indicate |
---|
1089 | an error for a byte range request that falls outside of the actual |
---|
1090 | contents of a document. (Section <xref target="status.416" format="counter"/>, <xref target="header.content-range" format="counter"/>) |
---|
1091 | </t> |
---|
1092 | </section> |
---|
1093 | |
---|
1094 | <section title="Changes from RFC 2616" anchor="changes.from.rfc.2616"> |
---|
1095 | <t> |
---|
1096 | Clarify that it is not ok to use a weak cache validator in a 206 response. |
---|
1097 | (<xref target="status.206"/>) |
---|
1098 | </t> |
---|
1099 | </section> |
---|
1100 | |
---|
1101 | </section> |
---|
1102 | |
---|
1103 | <section title="Change Log (to be removed by RFC Editor before publication)"> |
---|
1104 | |
---|
1105 | <section title="Since RFC2616"> |
---|
1106 | <t> |
---|
1107 | Extracted relevant partitions from <xref target="RFC2616"/>. |
---|
1108 | </t> |
---|
1109 | </section> |
---|
1110 | |
---|
1111 | <section title="Since draft-ietf-httpbis-p5-range-00"> |
---|
1112 | <t> |
---|
1113 | Closed issues: |
---|
1114 | <list style="symbols"> |
---|
1115 | <t> |
---|
1116 | <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/18"/>: |
---|
1117 | "Cache validators in 206 responses" |
---|
1118 | (<eref target="http://purl.org/NET/http-errata#ifrange206"/>) |
---|
1119 | </t> |
---|
1120 | <t> |
---|
1121 | <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/86"/>: |
---|
1122 | "Normative up-to-date references" |
---|
1123 | </t> |
---|
1124 | </list> |
---|
1125 | </t> |
---|
1126 | <t> |
---|
1127 | Other changes: |
---|
1128 | <list style="symbols"> |
---|
1129 | <t> |
---|
1130 | Categorize references as "Normative" or "Informative". |
---|
1131 | </t> |
---|
1132 | </list> |
---|
1133 | </t> |
---|
1134 | </section> |
---|
1135 | |
---|
1136 | </section> |
---|
1137 | |
---|
1138 | </back> |
---|
1139 | </rfc> |
---|