source: draft-ietf-httpbis/latest/p5-range.xml @ 229

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

add linking between ABNF rules (does not affect TXT version), relates to #36.

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