source: draft-ietf-httpbis/03/p5-range.xml @ 264

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

Prepare for release of draft 03 on Tuesday, 2008-06-17.

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