source: draft-ietf-httpbis/04/draft-ietf-httpbis-p5-range-04.xml @ 875

Last change on this file since 875 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.7 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-04">
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="August" year="2008" day="29"/>
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                         
461  instance-length         = 1*DIGIT
462]]></artwork></figure>
463<t>
464   The header SHOULD indicate the total length of the full entity-body,
465   unless this length is unknown or difficult to determine. The asterisk
466   "*" character means that the instance-length is unknown at the time
467   when the response was generated.
468</t>
469<t>
470   Unlike byte-ranges-specifier values (see <xref target="byte.ranges"/>), a byte-range-resp-spec
471   MUST only specify one range, and MUST contain
472   absolute byte positions for both the first and last byte of the
473   range.
474</t>
475<t>
476   A byte-content-range-spec with a byte-range-resp-spec whose last-byte-pos
477   value is less than its first-byte-pos value, or whose
478   instance-length value is less than or equal to its last-byte-pos
479   value, is invalid. The recipient of an invalid byte-content-range-spec
480   MUST ignore it and any content transferred along with it.
481</t>
482<t>
483   A server sending a response with status code 416 (Requested range not
484   satisfiable) SHOULD include a Content-Range field with a byte-range-resp-spec
485   of "*". The instance-length specifies the current length of
486   the selected resource. A response with status code 206 (Partial
487   Content) MUST NOT include a Content-Range field with a byte-range-resp-spec of "*".
488</t>
489<t>
490   Examples of byte-content-range-spec values, assuming that the entity
491   contains a total of 1234 bytes:
492   <list style="symbols">
493      <t>
494        The first 500 bytes:
495<figure><artwork type="text/plain"><![CDATA[
496   bytes 0-499/1234
497]]></artwork></figure>
498      </t>   
499      <t>
500        The second 500 bytes:
501<figure><artwork type="text/plain"><![CDATA[
502   bytes 500-999/1234
503]]></artwork></figure>
504      </t>   
505      <t>
506        All except for the first 500 bytes:
507<figure><artwork type="text/plain"><![CDATA[
508   bytes 500-1233/1234
509]]></artwork></figure>
510      </t>   
511      <t>
512        The last 500 bytes:
513<figure><artwork type="text/plain"><![CDATA[
514   bytes 734-1233/1234
515]]></artwork></figure>
516      </t>   
517   </list>
518</t>
519<t>
520   When an HTTP message includes the content of a single range (for
521   example, a response to a request for a single range, or to a request
522   for a set of ranges that overlap without any holes), this content is
523   transmitted with a Content-Range header, and a Content-Length header
524   showing the number of bytes actually transferred. For example,
525</t>
526<figure><artwork type="example"><![CDATA[
527    HTTP/1.1 206 Partial Content
528    Date: Wed, 15 Nov 1995 06:25:24 GMT
529    Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
530    Content-Range: bytes 21010-47021/47022
531    Content-Length: 26012
532    Content-Type: image/gif
533]]></artwork></figure>
534<t>
535   When an HTTP message includes the content of multiple ranges (for
536   example, a response to a request for multiple non-overlapping
537   ranges), these are transmitted as a multipart message. The multipart
538   media type used for this purpose is "multipart/byteranges" as defined
539   in <xref target="internet.media.type.multipart.byteranges"/>. See <xref target="changes.from.rfc.2068"/> for a compatibility issue.
540</t>
541<t>
542   A response to a request for a single range MUST NOT be sent using the
543   multipart/byteranges media type.  A response to a request for
544   multiple ranges, whose result is a single range, MAY be sent as a
545   multipart/byteranges media type with one part. A client that cannot
546   decode a multipart/byteranges message MUST NOT ask for multiple
547   byte-ranges in a single request.
548</t>
549<t>
550   When a client requests multiple byte-ranges in one request, the
551   server SHOULD return them in the order that they appeared in the
552   request.
553</t>
554<t>
555   If the server ignores a byte-range-spec because it is syntactically
556   invalid, the server SHOULD treat the request as if the invalid Range
557   header field did not exist. (Normally, this means return a 200
558   response containing the full entity).
559</t>
560<t>
561   If the server receives a request (other than one including an If-Range
562   request-header field) with an unsatisfiable Range request-header
563   field (that is, all of whose byte-range-spec values have a
564   first-byte-pos value greater than the current length of the selected
565   resource), it SHOULD return a response code of 416 (Requested range
566   not satisfiable) (<xref target="status.416"/>).
567  <list><t>
568      Note: clients cannot depend on servers to send a 416 (Requested
569      range not satisfiable) response instead of a 200 (OK) response for
570      an unsatisfiable Range request-header, since not all servers
571      implement this request-header.
572  </t></list>
573</t>
574</section>
575
576<section title="If-Range" anchor="header.if-range">
577  <iref primary="true" item="If-Range header"/>
578  <iref primary="true" item="Headers" subitem="If-Range"/>
579 
580<t>
581   If a client has a partial copy of an entity in its cache, and wishes
582   to have an up-to-date copy of the entire entity in its cache, it
583   could use the Range request-header with a conditional GET (using
584   either or both of If-Unmodified-Since and If-Match.) However, if the
585   condition fails because the entity has been modified, the client
586   would then have to make a second request to obtain the entire current
587   entity-body.
588</t>
589<t>
590   The If-Range header allows a client to "short-circuit" the second
591   request. Informally, its meaning is `if the entity is unchanged, send
592   me the part(s) that I am missing; otherwise, send me the entire new
593   entity'.
594</t>
595<figure><iref primary="true" item="Grammar" subitem="If-Range"/><artwork type="abnf2616"><![CDATA[
596  If-Range = "If-Range" ":" ( entity-tag | HTTP-date )
597]]></artwork></figure>
598<t>
599   If the client has no entity tag for an entity, but does have a Last-Modified
600   date, it MAY use that date in an If-Range header. (The
601   server can distinguish between a valid HTTP-date and any form of
602   entity-tag by examining no more than two characters.) The If-Range
603   header SHOULD only be used together with a Range header, and MUST be
604   ignored if the request does not include a Range header, or if the
605   server does not support the sub-range operation.
606</t>
607<t>
608   If the entity tag given in the If-Range header matches the current
609   entity tag for the entity, then the server SHOULD provide the
610   specified sub-range of the entity using a 206 (Partial Content)
611   response. If the entity tag does not match, then the server SHOULD
612   return the entire entity using a 200 (OK) response.
613</t>
614</section>
615
616<section title="Range" anchor="header.range">
617  <iref primary="true" item="Range header"/>
618  <iref primary="true" item="Headers" subitem="Range"/>
619
620<section title="Byte Ranges" anchor="byte.ranges">
621<t>
622   Since all HTTP entities are represented in HTTP messages as sequences
623   of bytes, the concept of a byte range is meaningful for any HTTP
624   entity. (However, not all clients and servers need to support byte-range
625   operations.)
626</t>
627<t>
628   Byte range specifications in HTTP apply to the sequence of bytes in
629   the entity-body (not necessarily the same as the message-body).
630</t>
631<t anchor="rule.ranges-specifier">
632 
633 
634 
635 
636 
637 
638 
639 
640   A byte range operation MAY specify a single range of bytes, or a set
641   of ranges within a single entity.
642</t>
643<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[
644  ranges-specifier = byte-ranges-specifier
645  byte-ranges-specifier = bytes-unit "=" byte-range-set
646  byte-range-set  = 1#( byte-range-spec | suffix-byte-range-spec )
647  byte-range-spec = first-byte-pos "-" [last-byte-pos]
648  first-byte-pos  = 1*DIGIT
649  last-byte-pos   = 1*DIGIT
650]]></artwork></figure>
651<t>
652   The first-byte-pos value in a byte-range-spec gives the byte-offset
653   of the first byte in a range. The last-byte-pos value gives the
654   byte-offset of the last byte in the range; that is, the byte
655   positions specified are inclusive. Byte offsets start at zero.
656</t>
657<t>
658   If the last-byte-pos value is present, it MUST be greater than or
659   equal to the first-byte-pos in that byte-range-spec, or the byte-range-spec
660   is syntactically invalid. The recipient of a byte-range-set
661   that includes one or more syntactically invalid byte-range-spec
662   values MUST ignore the header field that includes that byte-range-set.
663</t>
664<t>
665   If the last-byte-pos value is absent, or if the value is greater than
666   or equal to the current length of the entity-body, last-byte-pos is
667   taken to be equal to one less than the current length of the entity-body
668   in bytes.
669</t>
670<t>
671   By its choice of last-byte-pos, a client can limit the number of
672   bytes retrieved without knowing the size of the entity.
673</t>
674<figure><iref primary="true" item="Grammar" subitem="suffix-byte-range-spec"/><iref primary="true" item="Grammar" subitem="suffix-length"/><artwork type="abnf2616"><![CDATA[
675  suffix-byte-range-spec = "-" suffix-length
676  suffix-length = 1*DIGIT
677]]></artwork></figure>
678<t>
679   A suffix-byte-range-spec is used to specify the suffix of the
680   entity-body, of a length given by the suffix-length value. (That is,
681   this form specifies the last N bytes of an entity-body.) If the
682   entity is shorter than the specified suffix-length, the entire
683   entity-body is used.
684</t>
685<t>
686   If a syntactically valid byte-range-set includes at least one byte-range-spec
687   whose first-byte-pos is less than the current length of
688   the entity-body, or at least one suffix-byte-range-spec with a non-zero
689   suffix-length, then the byte-range-set is satisfiable.
690   Otherwise, the byte-range-set is unsatisfiable. If the byte-range-set
691   is unsatisfiable, the server SHOULD return a response with a status
692   of 416 (Requested range not satisfiable). Otherwise, the server
693   SHOULD return a response with a status of 206 (Partial Content)
694   containing the satisfiable ranges of the entity-body.
695</t>
696<t>
697   Examples of byte-ranges-specifier values (assuming an entity-body of
698   length 10000):
699  <list style="symbols">
700     <t>The first 500 bytes (byte offsets 0-499, inclusive):  bytes=0-499</t>
701
702     <t>The second 500 bytes (byte offsets 500-999, inclusive):
703        bytes=500-999</t>
704
705     <t>The final 500 bytes (byte offsets 9500-9999, inclusive):
706        bytes=-500</t>
707
708     <t>Or bytes=9500-</t>
709
710     <t>The first and last bytes only (bytes 0 and 9999):  bytes=0-0,-1</t>
711
712     <t>Several legal but not canonical specifications of the second 500
713        bytes (byte offsets 500-999, inclusive):
714        <vspace/>
715         bytes=500-600,601-999<vspace/>
716         bytes=500-700,601-999</t>
717  </list>
718</t>
719</section>
720
721<section title="Range Retrieval Requests" anchor="range.retrieval.requests">
722 
723<t>
724   HTTP retrieval requests using conditional or unconditional GET
725   methods MAY request one or more sub-ranges of the entity, instead of
726   the entire entity, using the Range request header, which applies to
727   the entity returned as the result of the request:
728</t>
729<figure><iref primary="true" item="Grammar" subitem="Range"/><artwork type="abnf2616"><![CDATA[
730  Range = "Range" ":" ranges-specifier
731]]></artwork></figure>
732<t>
733   A server MAY ignore the Range header. However, HTTP/1.1 origin
734   servers and intermediate caches ought to support byte ranges when
735   possible, since Range supports efficient recovery from partially
736   failed transfers, and supports efficient partial retrieval of large
737   entities.
738</t>
739<t>
740   If the server supports the Range header and the specified range or
741   ranges are appropriate for the entity:
742  <list style="symbols">
743     <t>The presence of a Range header in an unconditional GET modifies
744        what is returned if the GET is otherwise successful. In other
745        words, the response carries a status code of 206 (Partial
746        Content) instead of 200 (OK).</t>
747
748     <t>The presence of a Range header in a conditional GET (a request
749        using one or both of If-Modified-Since and If-None-Match, or
750        one or both of If-Unmodified-Since and If-Match) modifies what
751        is returned if the GET is otherwise successful and the
752        condition is true. It does not affect the 304 (Not Modified)
753        response returned if the conditional is false.</t>
754  </list>
755</t>
756<t>
757   In some cases, it might be more appropriate to use the If-Range
758   header (see <xref target="header.if-range"/>) in addition to the Range header.
759</t>
760<t>
761   If a proxy that supports ranges receives a Range request, forwards
762   the request to an inbound server, and receives an entire entity in
763   reply, it SHOULD only return the requested range to its client. It
764   SHOULD store the entire received response in its cache if that is
765   consistent with its cache allocation policies.
766</t>
767</section>
768</section>
769</section>
770
771<section title="IANA Considerations" anchor="IANA.considerations">
772<section title="Message Header Registration" anchor="message.header.registration">
773<t>
774   The Message Header Registry located at <eref target="http://www.iana.org/assignments/message-headers/message-header-index.html"/> should be updated
775   with the permanent registrations below (see <xref target="RFC3864"/>):
776</t>
777<!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually-->
778<texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
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   <c>Content-Range</c>
791   <c>http</c>
792   <c>standard</c>
793   <c>
794      <xref target="header.content-range"/>
795   </c>
796   <c>If-Range</c>
797   <c>http</c>
798   <c>standard</c>
799   <c>
800      <xref target="header.if-range"/>
801   </c>
802   <c>Range</c>
803   <c>http</c>
804   <c>standard</c>
805   <c>
806      <xref target="header.range"/>
807   </c>
808</texttable>
809<!--(END)-->
810<t>
811   The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".
812</t>
813</section>
814</section>
815
816<section title="Security Considerations" anchor="security.considerations">
817<t>
818   No additional security considerations have been identified beyond
819   those applicable to HTTP in general <xref target="Part1"/>.
820</t>
821</section>
822
823<section title="Acknowledgments" anchor="ack">
824<t>
825   Most of the specification of ranges is based on work originally done
826   by Ari Luotonen and John Franks, with additional input from Steve
827   Zilles, Daniel W. Connolly, Roy T. Fielding, Jim Gettys, Martin Hamilton,
828   Koen Holtman, Shel Kaplan, Paul Leach, Alex Lopez-Ortiz, Larry Masinter,
829   Jeff Mogul, Lou Montulli, David W. Morris, Luigi Rizzo, and Bill Weihl.
830</t>
831</section>
832</middle>
833<back>
834
835<references title="Normative References">
836
837<reference anchor="Part1">
838  <front>
839    <title abbrev="HTTP/1.1">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</title>
840    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
841      <organization abbrev="Day Software">Day Software</organization>
842      <address><email>fielding@gbiv.com</email></address>
843    </author>
844    <author initials="J." surname="Gettys" fullname="Jim Gettys">
845      <organization>One Laptop per Child</organization>
846      <address><email>jg@laptop.org</email></address>
847    </author>
848    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
849      <organization abbrev="HP">Hewlett-Packard Company</organization>
850      <address><email>JeffMogul@acm.org</email></address>
851    </author>
852    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
853      <organization abbrev="Microsoft">Microsoft Corporation</organization>
854      <address><email>henrikn@microsoft.com</email></address>
855    </author>
856    <author initials="L." surname="Masinter" fullname="Larry Masinter">
857      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
858      <address><email>LMM@acm.org</email></address>
859    </author>
860    <author initials="P." surname="Leach" fullname="Paul J. Leach">
861      <organization abbrev="Microsoft">Microsoft Corporation</organization>
862      <address><email>paulle@microsoft.com</email></address>
863    </author>
864    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
865      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
866      <address><email>timbl@w3.org</email></address>
867    </author>
868    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
869      <organization abbrev="W3C">World Wide Web Consortium</organization>
870      <address><email>ylafon@w3.org</email></address>
871    </author>
872    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
873      <organization abbrev="greenbytes">greenbytes GmbH</organization>
874      <address><email>julian.reschke@greenbytes.de</email></address>
875    </author>
876    <date month="August" year="2008"/>
877  </front>
878  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-04"/>
879 
880</reference>
881
882<reference anchor="Part3">
883  <front>
884    <title abbrev="HTTP/1.1">HTTP/1.1, part 3: Message Payload and Content Negotiation</title>
885    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
886      <organization abbrev="Day Software">Day Software</organization>
887      <address><email>fielding@gbiv.com</email></address>
888    </author>
889    <author initials="J." surname="Gettys" fullname="Jim Gettys">
890      <organization>One Laptop per Child</organization>
891      <address><email>jg@laptop.org</email></address>
892    </author>
893    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
894      <organization abbrev="HP">Hewlett-Packard Company</organization>
895      <address><email>JeffMogul@acm.org</email></address>
896    </author>
897    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
898      <organization abbrev="Microsoft">Microsoft Corporation</organization>
899      <address><email>henrikn@microsoft.com</email></address>
900    </author>
901    <author initials="L." surname="Masinter" fullname="Larry Masinter">
902      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
903      <address><email>LMM@acm.org</email></address>
904    </author>
905    <author initials="P." surname="Leach" fullname="Paul J. Leach">
906      <organization abbrev="Microsoft">Microsoft Corporation</organization>
907      <address><email>paulle@microsoft.com</email></address>
908    </author>
909    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
910      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
911      <address><email>timbl@w3.org</email></address>
912    </author>
913    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
914      <organization abbrev="W3C">World Wide Web Consortium</organization>
915      <address><email>ylafon@w3.org</email></address>
916    </author>
917    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
918      <organization abbrev="greenbytes">greenbytes GmbH</organization>
919      <address><email>julian.reschke@greenbytes.de</email></address>
920    </author>
921    <date month="August" year="2008"/>
922  </front>
923  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p3-payload-04"/>
924 
925</reference>
926
927<reference anchor="Part4">
928  <front>
929    <title abbrev="HTTP/1.1">HTTP/1.1, part 4: Conditional Requests</title>
930    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
931      <organization abbrev="Day Software">Day Software</organization>
932      <address><email>fielding@gbiv.com</email></address>
933    </author>
934    <author initials="J." surname="Gettys" fullname="Jim Gettys">
935      <organization>One Laptop per Child</organization>
936      <address><email>jg@laptop.org</email></address>
937    </author>
938    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
939      <organization abbrev="HP">Hewlett-Packard Company</organization>
940      <address><email>JeffMogul@acm.org</email></address>
941    </author>
942    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
943      <organization abbrev="Microsoft">Microsoft Corporation</organization>
944      <address><email>henrikn@microsoft.com</email></address>
945    </author>
946    <author initials="L." surname="Masinter" fullname="Larry Masinter">
947      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
948      <address><email>LMM@acm.org</email></address>
949    </author>
950    <author initials="P." surname="Leach" fullname="Paul J. Leach">
951      <organization abbrev="Microsoft">Microsoft Corporation</organization>
952      <address><email>paulle@microsoft.com</email></address>
953    </author>
954    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
955      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
956      <address><email>timbl@w3.org</email></address>
957    </author>
958    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
959      <organization abbrev="W3C">World Wide Web Consortium</organization>
960      <address><email>ylafon@w3.org</email></address>
961    </author>
962    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
963      <organization abbrev="greenbytes">greenbytes GmbH</organization>
964      <address><email>julian.reschke@greenbytes.de</email></address>
965    </author>
966    <date month="August" year="2008"/>
967  </front>
968  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p4-conditional-04"/>
969 
970</reference>
971
972<reference anchor="Part6">
973  <front>
974    <title abbrev="HTTP/1.1">HTTP/1.1, part 6: Caching</title>
975    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
976      <organization abbrev="Day Software">Day Software</organization>
977      <address><email>fielding@gbiv.com</email></address>
978    </author>
979    <author initials="J." surname="Gettys" fullname="Jim Gettys">
980      <organization>One Laptop per Child</organization>
981      <address><email>jg@laptop.org</email></address>
982    </author>
983    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
984      <organization abbrev="HP">Hewlett-Packard Company</organization>
985      <address><email>JeffMogul@acm.org</email></address>
986    </author>
987    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
988      <organization abbrev="Microsoft">Microsoft Corporation</organization>
989      <address><email>henrikn@microsoft.com</email></address>
990    </author>
991    <author initials="L." surname="Masinter" fullname="Larry Masinter">
992      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
993      <address><email>LMM@acm.org</email></address>
994    </author>
995    <author initials="P." surname="Leach" fullname="Paul J. Leach">
996      <organization abbrev="Microsoft">Microsoft Corporation</organization>
997      <address><email>paulle@microsoft.com</email></address>
998    </author>
999    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1000      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1001      <address><email>timbl@w3.org</email></address>
1002    </author>
1003    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1004      <organization abbrev="W3C">World Wide Web Consortium</organization>
1005      <address><email>ylafon@w3.org</email></address>
1006    </author>
1007    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1008      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1009      <address><email>julian.reschke@greenbytes.de</email></address>
1010    </author>
1011    <date month="August" year="2008"/>
1012  </front>
1013  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-04"/>
1014 
1015</reference>
1016
1017<reference anchor="RFC2046">
1018  <front>
1019    <title abbrev="Media Types">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</title>
1020    <author initials="N." surname="Freed" fullname="Ned Freed">
1021      <organization>Innosoft International, Inc.</organization>
1022      <address><email>ned@innosoft.com</email></address>
1023    </author>
1024    <author initials="N." surname="Borenstein" fullname="Nathaniel S. Borenstein">
1025      <organization>First Virtual Holdings</organization>
1026      <address><email>nsb@nsb.fv.com</email></address>
1027    </author>
1028    <date month="November" year="1996"/>
1029  </front>
1030  <seriesInfo name="RFC" value="2046"/>
1031</reference>
1032
1033<reference anchor="RFC2119">
1034  <front>
1035    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
1036    <author initials="S." surname="Bradner" fullname="Scott Bradner">
1037      <organization>Harvard University</organization>
1038      <address><email>sob@harvard.edu</email></address>
1039    </author>
1040    <date month="March" year="1997"/>
1041  </front>
1042  <seriesInfo name="BCP" value="14"/>
1043  <seriesInfo name="RFC" value="2119"/>
1044</reference>
1045
1046</references>
1047
1048<references title="Informative References">
1049
1050<reference anchor="RFC2616">
1051  <front>
1052    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
1053    <author initials="R." surname="Fielding" fullname="R. Fielding">
1054      <organization>University of California, Irvine</organization>
1055      <address><email>fielding@ics.uci.edu</email></address>
1056    </author>
1057    <author initials="J." surname="Gettys" fullname="J. Gettys">
1058      <organization>W3C</organization>
1059      <address><email>jg@w3.org</email></address>
1060    </author>
1061    <author initials="J." surname="Mogul" fullname="J. Mogul">
1062      <organization>Compaq Computer Corporation</organization>
1063      <address><email>mogul@wrl.dec.com</email></address>
1064    </author>
1065    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
1066      <organization>MIT Laboratory for Computer Science</organization>
1067      <address><email>frystyk@w3.org</email></address>
1068    </author>
1069    <author initials="L." surname="Masinter" fullname="L. Masinter">
1070      <organization>Xerox Corporation</organization>
1071      <address><email>masinter@parc.xerox.com</email></address>
1072    </author>
1073    <author initials="P." surname="Leach" fullname="P. Leach">
1074      <organization>Microsoft Corporation</organization>
1075      <address><email>paulle@microsoft.com</email></address>
1076    </author>
1077    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
1078      <organization>W3C</organization>
1079      <address><email>timbl@w3.org</email></address>
1080    </author>
1081    <date month="June" year="1999"/>
1082  </front>
1083  <seriesInfo name="RFC" value="2616"/>
1084</reference>
1085
1086<reference anchor="RFC3864">
1087  <front>
1088    <title>Registration Procedures for Message Header Fields</title>
1089    <author initials="G." surname="Klyne" fullname="G. Klyne">
1090      <organization>Nine by Nine</organization>
1091      <address><email>GK-IETF@ninebynine.org</email></address>
1092    </author>
1093    <author initials="M." surname="Nottingham" fullname="M. Nottingham">
1094      <organization>BEA Systems</organization>
1095      <address><email>mnot@pobox.com</email></address>
1096    </author>
1097    <author initials="J." surname="Mogul" fullname="J. Mogul">
1098      <organization>HP Labs</organization>
1099      <address><email>JeffMogul@acm.org</email></address>
1100    </author>
1101    <date year="2004" month="September"/>
1102  </front>
1103  <seriesInfo name="BCP" value="90"/>
1104  <seriesInfo name="RFC" value="3864"/>
1105</reference>
1106
1107<reference anchor="RFC4288">
1108  <front>
1109    <title>Media Type Specifications and Registration Procedures</title>
1110    <author initials="N." surname="Freed" fullname="N. Freed">
1111      <organization>Sun Microsystems</organization>
1112      <address>
1113        <email>ned.freed@mrochek.com</email>
1114      </address>
1115    </author>
1116    <author initials="J." surname="Klensin" fullname="J. Klensin">
1117      <organization/>
1118      <address>
1119        <email>klensin+ietf@jck.com</email>
1120      </address>
1121    </author>
1122    <date year="2005" month="December"/>
1123  </front>
1124  <seriesInfo name="BCP" value="13"/>
1125  <seriesInfo name="RFC" value="4288"/>
1126</reference>
1127
1128</references>
1129
1130<section title="Internet Media Type multipart/byteranges" anchor="internet.media.type.multipart.byteranges">
1131<iref item="Media Type" subitem="multipart/byteranges" primary="true"/>
1132<iref item="multipart/byteranges Media Type" primary="true"/>
1133<t>
1134   When an HTTP 206 (Partial Content) response message includes the
1135   content of multiple ranges (a response to a request for multiple
1136   non-overlapping ranges), these are transmitted as a multipart
1137   message-body <xref target="RFC2046"/>. The media type for this purpose is called
1138   "multipart/byteranges".  The following is to be registered with IANA <xref target="RFC4288"/>.
1139</t><t>
1140   The multipart/byteranges media type includes two or more parts, each
1141   with its own Content-Type and Content-Range fields. The required
1142   boundary parameter specifies the boundary string used to separate
1143   each body-part.
1144</t>
1145<t>
1146  <list style="hanging">
1147    <t hangText="Type name:">
1148      multipart
1149    </t>
1150    <t hangText="Subtype name:">
1151      byteranges
1152    </t>
1153    <t hangText="Required parameters:">
1154      boundary
1155    </t>
1156    <t hangText="Optional parameters:">
1157      none
1158    </t>
1159    <t hangText="Encoding considerations:">
1160      only "7bit", "8bit", or "binary" are permitted
1161    </t>
1162    <t hangText="Security considerations:">
1163      none
1164    </t>
1165    <t hangText="Interoperability considerations:">
1166      none
1167    </t>
1168    <t hangText="Published specification:">
1169      This specification (see <xref target="internet.media.type.multipart.byteranges"/>).
1170    </t>
1171    <t hangText="Applications that use this media type:">
1172    </t>
1173    <t hangText="Additional information:">
1174      <list style="hanging">
1175        <t hangText="Magic number(s):">none</t>
1176        <t hangText="File extension(s):">none</t>
1177        <t hangText="Macintosh file type code(s):">none</t>
1178      </list>
1179    </t>
1180    <t hangText="Person and email address to contact for further information:">
1181      See Authors Section.
1182    </t>
1183                <t hangText="Intended usage:">
1184                  COMMON
1185    </t>
1186                <t hangText="Restrictions on usage:">
1187                  none
1188    </t>
1189    <t hangText="Author/Change controller:">
1190      IESG
1191    </t>
1192  </list>
1193</t>
1194<figure><preamble>
1195   For example:
1196</preamble><artwork type="example"><![CDATA[
1197   HTTP/1.1 206 Partial Content
1198   Date: Wed, 15 Nov 1995 06:25:24 GMT
1199   Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
1200   Content-type: multipart/byteranges; boundary=THIS_STRING_SEPARATES
1201
1202   --THIS_STRING_SEPARATES
1203   Content-type: application/pdf
1204   Content-range: bytes 500-999/8000
1205
1206   ...the first range...
1207   --THIS_STRING_SEPARATES
1208   Content-type: application/pdf
1209   Content-range: bytes 7000-7999/8000
1210
1211   ...the second range
1212   --THIS_STRING_SEPARATES--
1213]]></artwork></figure>
1214<t>
1215      Notes:
1216  <list style="numbers">
1217      <t>Additional CRLFs may precede the first boundary string in the
1218         entity.</t>
1219
1220      <t>Although <xref target="RFC2046"/> permits the boundary string to be
1221         quoted, some existing implementations handle a quoted boundary
1222         string incorrectly.</t>
1223
1224      <t>A number of browsers and servers were coded to an early draft
1225         of the byteranges specification to use a media type of
1226         multipart/x-byteranges<iref item="multipart/x-byteranges Media Type"/><iref item="Media Type" subitem="multipart/x-byteranges"/>, which is almost, but not quite
1227         compatible with the version documented in HTTP/1.1.</t>
1228  </list>
1229</t>
1230</section>
1231
1232<section title="Compatibility with Previous Versions" anchor="compatibility">
1233<section title="Changes from RFC 2068" anchor="changes.from.rfc.2068">
1234<t>
1235   Transfer-coding and message lengths all interact in ways that
1236   required fixing exactly when chunked encoding is used (to allow for
1237   transfer encoding that may not be self delimiting); it was important
1238   to straighten out exactly how message lengths are computed.
1239   (<xref target="header.content-range"/>,
1240   see also <xref target="Part1"/>, <xref target="Part3"/> and <xref target="Part6"/>)
1241</t>
1242<t>
1243   There are situations where a server (especially a proxy) does not
1244   know the full length of a response but is capable of serving a
1245   byterange request. We therefore need a mechanism to allow byteranges
1246   with a content-range not indicating the full length of the message.
1247   (<xref target="header.content-range"/>)
1248</t>
1249<t>
1250   Range request responses would become very verbose if all meta-data
1251   were always returned; by allowing the server to only send needed
1252   headers in a 206 response, this problem can be avoided.
1253   (Section <xref target="status.206" format="counter"/>
1254   and <xref target="header.if-range" format="counter"/>)
1255</t>
1256<t>
1257   Fix problem with unsatisfiable range requests; there are two cases:
1258   syntactic problems, and range doesn't exist in the document. The 416
1259   status code was needed to resolve this ambiguity needed to indicate
1260   an error for a byte range request that falls outside of the actual
1261   contents of a document. (Section <xref target="status.416" format="counter"/>, <xref target="header.content-range" format="counter"/>)
1262</t>
1263</section>
1264
1265<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
1266<t>
1267  Clarify that it is not ok to use a weak cache validator in a 206 response.
1268  (<xref target="status.206"/>)
1269</t>
1270</section>
1271
1272</section>
1273
1274<section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log">
1275
1276<section title="Since RFC2616">
1277<t>
1278  Extracted relevant partitions from <xref target="RFC2616"/>.
1279</t>
1280</section>
1281
1282<section title="Since draft-ietf-httpbis-p5-range-00">
1283<t>
1284  Closed issues:
1285  <list style="symbols"> 
1286    <t>
1287      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/18"/>:
1288      "Cache validators in 206 responses"
1289      (<eref target="http://purl.org/NET/http-errata#ifrange206"/>)
1290    </t>
1291    <t>
1292      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/35"/>:
1293      "Normative and Informative references"
1294    </t>
1295    <t>
1296      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/86"/>:
1297      "Normative up-to-date references"
1298    </t>
1299  </list>
1300</t>
1301</section>
1302
1303<section title="Since draft-ietf-httpbis-p5-range-01">
1304<t>
1305  Closed issues:
1306  <list style="symbols"> 
1307    <t>
1308      <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/55"/>:
1309      "Updating to RFC4288"
1310    </t>
1311  </list>
1312</t>
1313<t>
1314  Ongoing work on ABNF conversion (<eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/36"/>):
1315  <list style="symbols"> 
1316    <t>
1317      Add explicit references to BNF syntax and rules imported from other parts of the specification.
1318    </t>
1319  </list>
1320</t>
1321</section>
1322
1323<section title="Since draft-ietf-httpbis-p5-range-02" anchor="changes.since.02">
1324<t>
1325  Ongoing work on IANA Message Header Registration (<eref target="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/40"/>):
1326  <list style="symbols"> 
1327    <t>
1328      Reference RFC 3984, and update header registrations for headers defined
1329      in this document.
1330    </t>
1331  </list>
1332</t>
1333</section>
1334
1335<section title="Since draft-ietf-httpbis-p5-range-03" anchor="changes.since.03">
1336<t>
1337</t>
1338</section>
1339
1340</section>
1341
1342</back>
1343</rfc>
Note: See TracBrowser for help on using the repository browser.