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

Last change on this file since 872 was 559, checked in by fielding@…, 11 years ago

remove executable and set eol-style for earlier drafts

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