source: draft-ietf-httpbis/09/draft-ietf-httpbis-p5-range-09.xml @ 772

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

Prepare publication of -09 drafts on March 08

File size: 60.3 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="pre5378Trust200902" docName="draft-ietf-httpbis-p5-range-09">
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="March" year="2010" day="8"/>
161  <workgroup>HTTPbis Working Group</workgroup>
162
163<abstract>
164<t>
165   The Hypertext Transfer Protocol (HTTP) is an application-level
166   protocol for distributed, collaborative, hypermedia information
167   systems. HTTP has been in use by the World Wide Web global information
168   initiative since 1990. This document is Part 5 of the seven-part specification
169   that defines the protocol referred to as "HTTP/1.1" and, taken together,
170   obsoletes RFC 2616.  Part 5 defines range-specific requests and
171   the rules for constructing and combining responses to those requests.
172</t>
173</abstract>
174
175<note title="Editorial Note (To be removed by RFC Editor)">
176  <t>
177    Discussion of this draft should take place on the HTTPBIS working group
178    mailing list (ietf-http-wg@w3.org). The current issues list is
179    at <eref target="http://tools.ietf.org/wg/httpbis/trac/report/11"/>
180    and related documents (including fancy diffs) can be found at
181    <eref target="http://tools.ietf.org/wg/httpbis/"/>.
182  </t>
183  <t>
184    The changes in this draft are summarized in <xref target="changes.since.08"/>.
185  </t>
186</note>
187</front>
188<middle>
189<section title="Introduction" anchor="introduction">
190<t>
191   HTTP clients often encounter interrupted data transfers as a result
192   of cancelled requests or dropped connections.  When a cache has stored
193   a partial representation, it is desirable to request the remainder
194   of that representation in a subsequent request rather than transfer
195   the entire representation.
196   There are also a number of Web applications that benefit from being
197   able to request only a subset of a larger representation, such as a
198   single page of a very large document or only part of an image to be
199   rendered by a device with limited local storage.
200</t>
201<t>
202   This document defines HTTP/1.1 range requests,
203   partial responses, and the multipart/byteranges media type.
204   The protocol for range requests is an OPTIONAL feature of HTTP,
205   designed so resources or recipients that do not implement this feature
206   can respond as if it is a normal GET request without impacting
207   interoperability.  Partial responses are indicated by a distinct status
208   code to not be mistaken for full responses by intermediate caches
209   that might not implement the feature.
210</t>
211<t>
212   Although the HTTP range request mechanism is designed to allow for
213   extensible range types, this specification only defines requests for
214   byte ranges.
215</t>
216
217<section title="Requirements" anchor="intro.requirements">
218<t>
219   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
220   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
221   document are to be interpreted as described in <xref target="RFC2119"/>.
222</t>
223<t>
224   An implementation is not compliant if it fails to satisfy one or more
225   of the MUST or REQUIRED level requirements for the protocols it
226   implements. An implementation that satisfies all the MUST or REQUIRED
227   level and all the SHOULD level requirements for its protocols is said
228   to be "unconditionally compliant"; one that satisfies all the MUST
229   level requirements but not all the SHOULD level requirements for its
230   protocols is said to be "conditionally compliant."
231</t>
232</section>
233
234<section title="Syntax Notation" anchor="notation">
235 
236 
237 
238 
239 
240 
241 
242 
243 
244<t>
245  This specification uses the ABNF syntax defined in Section 1.2 of <xref target="Part1"/> (which
246  extends the syntax defined in <xref target="RFC5234"/> with a list rule).
247  <xref target="collected.abnf"/> shows the collected ABNF, with the list
248  rule expanded.
249</t>
250<t>
251  The following core rules are included by
252  reference, as defined in <xref target="RFC5234"/>, Appendix B.1:
253  ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls),
254  DIGIT (decimal 0-9), DQUOTE (double quote),
255  HEXDIG (hexadecimal 0-9/A-F/a-f), LF (line feed),
256  OCTET (any 8-bit sequence of data), SP (space),
257  VCHAR (any visible USASCII character),
258  and WSP (whitespace).
259</t>
260
261<section title="Core Rules" anchor="core.rules">
262 
263 
264<t>
265  The core rules below are defined in Section 1.2.2 of <xref target="Part1"/>:
266</t>
267<figure><artwork type="abnf2616"><![CDATA[
268  token      = <token, defined in [Part1], Section 1.2.2>
269  OWS        = <OWS, defined in [Part1], Section 1.2.2>
270]]></artwork></figure>
271</section>
272
273<section title="ABNF Rules defined in other Parts of the Specification" anchor="abnf.dependencies">
274 
275 
276<t>
277  The ABNF rules below are defined in other parts:
278</t>
279<figure><artwork type="abnf2616"><![CDATA[
280  HTTP-date  = <HTTP-date, defined in [Part1], Section 6.1>
281]]></artwork></figure>
282<figure><artwork type="abnf2616"><![CDATA[
283  entity-tag = <entity-tag, defined in [Part4], Section 2>
284]]></artwork></figure>
285</section>
286
287</section>
288
289</section>
290
291
292<section title="Range Units" anchor="range.units">
293 
294 
295 
296<t>
297   HTTP/1.1 allows a client to request that only part (a range of) the
298   response entity be included within the response. HTTP/1.1 uses range
299   units in the Range (<xref target="header.range"/>) and Content-Range (<xref target="header.content-range"/>)
300   header fields. An entity can be broken down into subranges according
301   to various structural units.
302</t>
303<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[
304  range-unit       = bytes-unit / other-range-unit
305  bytes-unit       = "bytes"
306  other-range-unit = token
307]]></artwork></figure>
308<t>
309  HTTP/1.1 has been designed to allow implementations of applications
310  that do not depend on knowledge of ranges. The only range unit defined
311  by HTTP/1.1 is "bytes".
312</t>
313<t>
314  If a range unit is not understood in a request, a server MUST ignore
315  the whole Range header (<xref target="header.range"/>).
316  If a range unit is not understood in a response, an intermediary
317  SHOULD pass the response to the client; a client MUST fail.
318</t>
319</section>
320
321<section title="Status Code Definitions">
322<section title="206 Partial Content" anchor="status.206">
323  <iref primary="true" item="206 Partial Content (status code)"/>
324  <iref primary="true" item="Status Codes" subitem="206 Partial Content"/>
325<t>
326   The server has fulfilled the partial GET request for the resource.
327   The request MUST have included a Range header field (<xref target="header.range"/>)
328   indicating the desired range, and MAY have included an If-Range
329   header field (<xref target="header.if-range"/>) to make the request conditional.
330</t>
331<t>
332   The response MUST include the following header fields:
333  <list style="symbols">
334    <t>
335        Either a Content-Range header field (<xref target="header.content-range"/>) indicating
336        the range included with this response, or a multipart/byteranges
337        Content-Type including Content-Range fields for each part. If a
338        Content-Length header field is present in the response, its
339        value MUST match the actual number of OCTETs transmitted in the
340        message-body.
341    </t>
342    <t>
343        Date
344    </t>
345    <t>
346        ETag and/or Content-Location, if the header would have been sent
347        in a 200 response to the same request
348    </t>
349    <t>
350        Expires, Cache-Control, and/or Vary, if the field-value might
351        differ from that sent in any previous response for the same
352        variant
353    </t>
354  </list>
355</t>
356<t>
357   If the 206 response is the result of an If-Range request, the response
358   SHOULD NOT include other entity-headers. Otherwise, the response
359   MUST include all of the entity-headers that would have been returned
360   with a 200 (OK) response to the same request.
361</t>
362<t>
363   A cache MUST NOT combine a 206 response with other previously cached
364   content if the ETag or Last-Modified headers do not match exactly,
365   see <xref target="combining.byte.ranges"/>.
366</t>
367<t>
368   A cache that does not support the Range and Content-Range headers
369   MUST NOT cache 206 (Partial Content) responses. Furthermore,
370   if a response uses a range unit that is not understood by the cache,
371   then it MUST NOT be cached either.
372</t>
373</section>
374
375<section title="416 Requested Range Not Satisfiable" anchor="status.416">
376  <iref primary="true" item="416 Requested Range Not Satisfiable (status code)"/>
377  <iref primary="true" item="Status Codes" subitem="416 Requested Range Not Satisfiable"/>
378<t>
379   A server SHOULD return a response with this status code if a request
380   included a Range request-header field (<xref target="header.range"/>), and none of
381   the ranges-specifier values in this field overlap the current extent
382   of the selected resource, and the request did not include an If-Range
383   request-header field. (For byte-ranges, this means that the first-byte-pos
384   of all of the byte-range-spec values were greater than the
385   current length of the selected resource.)
386</t>
387<t>
388   When this status code is returned for a byte-range request, the
389   response SHOULD include a Content-Range entity-header field
390   specifying the current length of the selected resource (see <xref target="header.content-range"/>).
391   This response MUST NOT use the multipart/byteranges content-type.
392</t>
393</section>
394</section>
395
396<section title="Combining Ranges" anchor="combining.byte.ranges">
397<t>
398   A response might transfer only a subrange of an entity-body, either because
399   the request included one or more Range specifications, or because
400   a connection was broken prematurely.
401   After several such transfers, a cache might have received several
402   ranges of the same entity-body.
403</t>
404<t>
405   If a cache has a stored non-empty set of subranges for an entity, and
406   an incoming response transfers another subrange, the cache MAY
407   combine the new subrange with the existing set if both the following
408   conditions are met:
409  <list style="symbols">
410    <t>Both the incoming response and the cache entry have a cache
411        validator.</t>
412    <t>The two cache validators match using the strong comparison
413        function (see Section 4 of <xref target="Part4"/>).</t>
414  </list>
415</t>
416<t>
417   If either requirement is not met, the cache MUST use only the most
418   recent partial response (based on the Date values transmitted with
419   every response, and using the incoming response if these values are
420   equal or missing), and MUST discard the other partial information.
421</t>
422</section>
423
424<section title="Header Field Definitions" anchor="header.fields">
425<t>
426   This section defines the syntax and semantics of HTTP/1.1 header fields
427   related to range requests and partial responses.
428</t>
429<t>
430   For entity-header fields, both sender and recipient refer to either the
431   client or the server, depending on who sends and who receives the entity.
432</t>
433
434<section title="Accept-Ranges" anchor="header.accept-ranges">
435  <iref primary="true" item="Accept-Ranges header"/>
436  <iref primary="true" item="Headers" subitem="Accept-Ranges"/>
437 
438 
439 
440<t>
441   The "Accept-Ranges" response-header field allows a resource to indicate
442   its acceptance of range requests.
443</t>
444<figure><iref primary="true" item="Grammar" subitem="Accept-Ranges"/><iref primary="true" item="Grammar" subitem="Accept-Ranges-v"/><iref primary="true" item="Grammar" subitem="acceptable-ranges"/><artwork type="abnf2616"><![CDATA[
445  Accept-Ranges     = "Accept-Ranges" ":" OWS Accept-Ranges-v
446  Accept-Ranges-v   = acceptable-ranges
447  acceptable-ranges = 1#range-unit / "none"
448]]></artwork></figure>
449<t>
450      Origin servers that accept byte-range requests MAY send
451</t>
452<figure><artwork type="example"><![CDATA[
453  Accept-Ranges: bytes
454]]></artwork></figure>
455<t>
456      but are not required to do so. Clients MAY generate range
457      requests without having received this header for the resource
458      involved. Range units are defined in <xref target="range.units"/>.
459</t>
460<t>
461      Servers that do not accept any kind of range request for a
462      resource MAY send
463</t>
464<figure><artwork type="example"><![CDATA[
465  Accept-Ranges: none
466]]></artwork></figure>
467<t>
468      to advise the client not to attempt a range request.
469</t>
470</section>
471
472<section title="Content-Range" anchor="header.content-range">
473  <iref primary="true" item="Content-Range header"/>
474  <iref primary="true" item="Headers" subitem="Content-Range"/>
475 
476 
477 
478 
479 
480 
481 
482 
483<t>
484   The "Content-Range" entity-header field is sent with a partial entity-body to
485   specify where in the full entity-body the partial body should be
486   applied. Range units are defined in <xref target="range.units"/>.
487</t>
488<figure><iref primary="true" item="Grammar" subitem="Content-Range"/><iref primary="true" item="Grammar" subitem="Content-Range-v"/><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[
489  Content-Range = "Content-Range" ":" OWS Content-Range-v
490  Content-Range-v = content-range-spec
491 
492  content-range-spec      = byte-content-range-spec
493                          / other-content-range-spec
494  byte-content-range-spec = bytes-unit SP
495                            byte-range-resp-spec "/"
496                            ( instance-length / "*" )
497 
498  byte-range-resp-spec    = (first-byte-pos "-" last-byte-pos)
499                          / "*"
500                         
501  instance-length         = 1*DIGIT
502 
503  other-content-range-spec = other-range-unit SP
504                             other-range-resp-spec
505  other-range-resp-spec    = *CHAR
506]]></artwork></figure>
507<t>
508   The header SHOULD indicate the total length of the full entity-body,
509   unless this length is unknown or difficult to determine. The asterisk
510   "*" character means that the instance-length is unknown at the time
511   when the response was generated.
512</t>
513<t>
514   Unlike byte-ranges-specifier values (see <xref target="byte.ranges"/>), a byte-range-resp-spec
515   MUST only specify one range, and MUST contain
516   absolute byte positions for both the first and last byte of the
517   range.
518</t>
519<t>
520   A byte-content-range-spec with a byte-range-resp-spec whose last-byte-pos
521   value is less than its first-byte-pos value, or whose
522   instance-length value is less than or equal to its last-byte-pos
523   value, is invalid. The recipient of an invalid byte-content-range-spec
524   MUST ignore it and any content transferred along with it.
525</t>
526<t>
527   In the case of a byte range request:
528   A server sending a response with status code 416 (Requested range not
529   satisfiable) SHOULD include a Content-Range field with a byte-range-resp-spec
530   of "*". The instance-length specifies the current length of
531   the selected resource. A response with status code 206 (Partial
532   Content) MUST NOT include a Content-Range field with a byte-range-resp-spec of "*".
533</t>
534<t>
535   Examples of byte-content-range-spec values, assuming that the entity
536   contains a total of 1234 bytes:
537   <list style="symbols">
538      <t>
539        The first 500 bytes:
540<figure><artwork type="example"><![CDATA[
541     bytes 0-499/1234
542   ]]></artwork></figure>
543      </t>   
544      <t>
545        The second 500 bytes:
546<figure><artwork type="example"><![CDATA[
547     bytes 500-999/1234
548   ]]></artwork></figure>
549      </t>   
550      <t>
551        All except for the first 500 bytes:
552<figure><artwork type="example"><![CDATA[
553     bytes 500-1233/1234
554   ]]></artwork></figure>
555      </t>   
556      <t>
557        The last 500 bytes:
558<figure><artwork type="example"><![CDATA[
559     bytes 734-1233/1234
560   ]]></artwork></figure>
561      </t>   
562   </list>
563</t>
564<t>
565   When an HTTP message includes the content of a single range (for
566   example, a response to a request for a single range, or to a request
567   for a set of ranges that overlap without any holes), this content is
568   transmitted with a Content-Range header, and a Content-Length header
569   showing the number of bytes actually transferred. For example,
570</t>
571<figure><artwork type="example"><![CDATA[
572  HTTP/1.1 206 Partial Content
573  Date: Wed, 15 Nov 1995 06:25:24 GMT
574  Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
575  Content-Range: bytes 21010-47021/47022
576  Content-Length: 26012
577  Content-Type: image/gif
578]]></artwork></figure>
579<t>
580   When an HTTP message includes the content of multiple ranges (for
581   example, a response to a request for multiple non-overlapping
582   ranges), these are transmitted as a multipart message. The multipart
583   media type used for this purpose is "multipart/byteranges" as defined
584   in <xref target="internet.media.type.multipart.byteranges"/>. See <xref target="changes.from.rfc.2068"/> for a compatibility issue.
585</t>
586<t>
587   A response to a request for a single range MUST NOT be sent using the
588   multipart/byteranges media type.  A response to a request for
589   multiple ranges, whose result is a single range, MAY be sent as a
590   multipart/byteranges media type with one part. A client that cannot
591   decode a multipart/byteranges message MUST NOT ask for multiple
592   ranges in a single request.
593</t>
594<t>
595   When a client requests multiple ranges in one request, the
596   server SHOULD return them in the order that they appeared in the
597   request.
598</t>
599<t>
600   If the server ignores a byte-range-spec because it is syntactically
601   invalid, the server SHOULD treat the request as if the invalid Range
602   header field did not exist. (Normally, this means return a 200
603   response containing the full entity).
604</t>
605<t>
606   If the server receives a request (other than one including an If-Range
607   request-header field) with an unsatisfiable Range request-header
608   field (that is, all of whose byte-range-spec values have a
609   first-byte-pos value greater than the current length of the selected
610   resource), it SHOULD return a response code of 416 (Requested range
611   not satisfiable) (<xref target="status.416"/>).
612</t>
613<t><list>
614  <t>
615    Note: Clients cannot depend on servers to send a 416 (Requested
616    range not satisfiable) response instead of a 200 (OK) response for
617    an unsatisfiable Range request-header, since not all servers
618    implement this request-header.
619  </t>
620</list></t>
621</section>
622
623<section title="If-Range" anchor="header.if-range">
624  <iref primary="true" item="If-Range header"/>
625  <iref primary="true" item="Headers" subitem="If-Range"/>
626 
627 
628<t>
629   If a client has a partial copy of an entity in its cache, and wishes
630   to have an up-to-date copy of the entire entity in its cache, it
631   could use the Range request-header with a conditional GET (using
632   either or both of If-Unmodified-Since and If-Match.) However, if the
633   condition fails because the entity has been modified, the client
634   would then have to make a second request to obtain the entire current
635   entity-body.
636</t>
637<t>
638   The "If-Range" request-header field allows a client to "short-circuit" the second
639   request. Informally, its meaning is "if the entity is unchanged, send
640   me the part(s) that I am missing; otherwise, send me the entire new
641   entity".
642</t>
643<figure><iref primary="true" item="Grammar" subitem="If-Range"/><iref primary="true" item="Grammar" subitem="If-Range-v"/><artwork type="abnf2616"><![CDATA[
644  If-Range   = "If-Range" ":" OWS If-Range-v
645  If-Range-v = entity-tag / HTTP-date
646]]></artwork></figure>
647<t>
648   If the client has no entity tag for an entity, but does have a Last-Modified
649   date, it MAY use that date in an If-Range header. (The
650   server can distinguish between a valid HTTP-date and any form of
651   entity-tag by examining no more than two characters.) The If-Range
652   header SHOULD only be used together with a Range header, and MUST be
653   ignored if the request does not include a Range header, or if the
654   server does not support the sub-range operation.
655</t>
656<t>
657   If the entity tag given in the If-Range header matches the current
658   cache validator for the entity, then the server SHOULD provide the
659   specified sub-range of the entity using a 206 (Partial Content)
660   response. If the cache validator does not match, then the server SHOULD
661   return the entire entity using a 200 (OK) response.
662</t>
663</section>
664
665<section title="Range" anchor="header.range">
666  <iref primary="true" item="Range header"/>
667  <iref primary="true" item="Headers" subitem="Range"/>
668
669<section title="Byte Ranges" anchor="byte.ranges">
670<t>
671   Since all HTTP entities are represented in HTTP messages as sequences
672   of bytes, the concept of a byte range is meaningful for any HTTP
673   entity. (However, not all clients and servers need to support byte-range
674   operations.)
675</t>
676<t>
677   Byte range specifications in HTTP apply to the sequence of bytes in
678   the entity-body (not necessarily the same as the message-body).
679</t>
680<t anchor="rule.ranges-specifier">
681 
682 
683 
684 
685 
686 
687 
688 
689
690   A byte range operation MAY specify a single range of bytes, or a set
691   of ranges within a single entity.
692</t>
693<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[
694  byte-ranges-specifier = bytes-unit "=" byte-range-set
695  byte-range-set  = 1#( byte-range-spec / suffix-byte-range-spec )
696  byte-range-spec = first-byte-pos "-" [ last-byte-pos ]
697  first-byte-pos  = 1*DIGIT
698  last-byte-pos   = 1*DIGIT
699]]></artwork></figure>
700<t>
701   The first-byte-pos value in a byte-range-spec gives the byte-offset
702   of the first byte in a range. The last-byte-pos value gives the
703   byte-offset of the last byte in the range; that is, the byte
704   positions specified are inclusive. Byte offsets start at zero.
705</t>
706<t>
707   If the last-byte-pos value is present, it MUST be greater than or
708   equal to the first-byte-pos in that byte-range-spec, or the byte-range-spec
709   is syntactically invalid. The recipient of a byte-range-set
710   that includes one or more syntactically invalid byte-range-spec
711   values MUST ignore the header field that includes that byte-range-set.
712</t>
713<t>
714   If the last-byte-pos value is absent, or if the value is greater than
715   or equal to the current length of the entity-body, last-byte-pos is
716   taken to be equal to one less than the current length of the entity-body
717   in bytes.
718</t>
719<t>
720   By its choice of last-byte-pos, a client can limit the number of
721   bytes retrieved without knowing the size of the entity.
722</t>
723<figure><iref primary="true" item="Grammar" subitem="suffix-byte-range-spec"/><iref primary="true" item="Grammar" subitem="suffix-length"/><artwork type="abnf2616"><![CDATA[
724  suffix-byte-range-spec = "-" suffix-length
725  suffix-length = 1*DIGIT
726]]></artwork></figure>
727<t>
728   A suffix-byte-range-spec is used to specify the suffix of the
729   entity-body, of a length given by the suffix-length value. (That is,
730   this form specifies the last N bytes of an entity-body.) If the
731   entity is shorter than the specified suffix-length, the entire
732   entity-body is used.
733</t>
734<t>
735   If a syntactically valid byte-range-set includes at least one byte-range-spec
736   whose first-byte-pos is less than the current length of
737   the entity-body, or at least one suffix-byte-range-spec with a non-zero
738   suffix-length, then the byte-range-set is satisfiable.
739   Otherwise, the byte-range-set is unsatisfiable. If the byte-range-set
740   is unsatisfiable, the server SHOULD return a response with a status
741   of 416 (Requested range not satisfiable). Otherwise, the server
742   SHOULD return a response with a status of 206 (Partial Content)
743   containing the satisfiable ranges of the entity-body.
744</t>
745<t>
746   Examples of byte-ranges-specifier values (assuming an entity-body of
747   length 10000):
748  <list style="symbols">
749     <t>The first 500 bytes (byte offsets 0-499, inclusive):
750<figure><artwork type="example"><![CDATA[
751     bytes=0-499
752   ]]></artwork></figure>
753    </t>
754     <t>The second 500 bytes (byte offsets 500-999, inclusive):
755<figure><artwork type="example"><![CDATA[
756     bytes=500-999
757   ]]></artwork></figure>
758    </t>
759     <t>The final 500 bytes (byte offsets 9500-9999, inclusive):
760<figure><artwork type="example"><![CDATA[
761     bytes=-500
762   ]]></artwork></figure>
763    Or:
764<figure><artwork type="example"><![CDATA[
765     bytes=9500-
766   ]]></artwork></figure>
767    </t>
768     <t>The first and last bytes only (bytes 0 and 9999):
769<figure><artwork type="example"><![CDATA[
770     bytes=0-0,-1
771   ]]></artwork></figure>
772     </t>
773     <t>Several legal but not canonical specifications of the second 500
774        bytes (byte offsets 500-999, inclusive):
775<figure><artwork type="example"><![CDATA[
776     bytes=500-600,601-999
777     bytes=500-700,601-999
778   ]]></artwork></figure>
779     </t>
780  </list>
781</t>
782</section>
783
784<section title="Range Retrieval Requests" anchor="range.retrieval.requests">
785 
786 
787 
788 
789<t>
790   The "Range" request-header field defines the GET method (conditional or
791   not) to request one or more sub-ranges of the response entity-body, instead
792   of the entire entity body.
793</t>
794<figure><iref primary="true" item="Grammar" subitem="Range"/><artwork type="abnf2616"><![CDATA[
795  Range   = "Range" ":" OWS Range-v
796  Range-v = byte-ranges-specifier
797          / other-ranges-specifier
798  other-ranges-specifier = other-range-unit "=" other-range-set
799  other-range-set = 1*CHAR
800]]></artwork></figure>
801<t>
802   A server MAY ignore the Range header. However, HTTP/1.1 origin
803   servers and intermediate caches ought to support byte ranges when
804   possible, since Range supports efficient recovery from partially
805   failed transfers, and supports efficient partial retrieval of large
806   entities.
807</t>
808<t>
809   If the server supports the Range header and the specified range or
810   ranges are appropriate for the entity:
811  <list style="symbols">
812     <t>The presence of a Range header in an unconditional GET modifies
813        what is returned if the GET is otherwise successful. In other
814        words, the response carries a status code of 206 (Partial
815        Content) instead of 200 (OK).</t>
816
817     <t>The presence of a Range header in a conditional GET (a request
818        using one or both of If-Modified-Since and If-None-Match, or
819        one or both of If-Unmodified-Since and If-Match) modifies what
820        is returned if the GET is otherwise successful and the
821        condition is true. It does not affect the 304 (Not Modified)
822        response returned if the conditional is false.</t>
823  </list>
824</t>
825<t>
826   In some cases, it might be more appropriate to use the If-Range
827   header (see <xref target="header.if-range"/>) in addition to the Range header.
828</t>
829<t>
830   If a proxy that supports ranges receives a Range request, forwards
831   the request to an inbound server, and receives an entire entity in
832   reply, it SHOULD only return the requested range to its client. It
833   SHOULD store the entire received response in its cache if that is
834   consistent with its cache allocation policies.
835</t>
836</section>
837</section>
838</section>
839
840<section title="IANA Considerations" anchor="IANA.considerations">
841
842<section title="Status Code Registration" anchor="status.code.registration">
843<t>
844   The HTTP Status Code Registry located at <eref target="http://www.iana.org/assignments/http-status-codes"/>
845   should be updated with the registrations below:
846</t>
847
848<!--AUTOGENERATED FROM extract-status-code-defs.xslt, do not edit manually-->
849<texttable align="left" suppress-title="true" anchor="iana.status.code.registration.table">
850   <ttcol>Value</ttcol>
851   <ttcol>Description</ttcol>
852   <ttcol>Reference</ttcol>
853   <c>206</c>
854   <c>Partial Content</c>
855   <c>
856      <xref target="status.206"/>
857   </c>
858   <c>416</c>
859   <c>Requested Range Not Satisfiable</c>
860   <c>
861      <xref target="status.416"/>
862   </c>
863</texttable>
864<!--(END)-->
865
866</section>
867
868<section title="Message Header Registration" anchor="message.header.registration">
869<t>
870   The Message Header Registry located at <eref target="http://www.iana.org/assignments/message-headers/message-header-index.html"/> should be updated
871   with the permanent registrations below (see <xref target="RFC3864"/>):
872</t>
873
874<!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually-->
875<texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
876   <ttcol>Header Field Name</ttcol>
877   <ttcol>Protocol</ttcol>
878   <ttcol>Status</ttcol>
879   <ttcol>Reference</ttcol>
880
881   <c>Accept-Ranges</c>
882   <c>http</c>
883   <c>standard</c>
884   <c>
885      <xref target="header.accept-ranges"/>
886   </c>
887   <c>Content-Range</c>
888   <c>http</c>
889   <c>standard</c>
890   <c>
891      <xref target="header.content-range"/>
892   </c>
893   <c>If-Range</c>
894   <c>http</c>
895   <c>standard</c>
896   <c>
897      <xref target="header.if-range"/>
898   </c>
899   <c>Range</c>
900   <c>http</c>
901   <c>standard</c>
902   <c>
903      <xref target="header.range"/>
904   </c>
905</texttable>
906<!--(END)-->
907
908<t>
909   The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".
910</t>
911</section>
912</section>
913
914<section title="Security Considerations" anchor="security.considerations">
915<t>
916   No additional security considerations have been identified beyond
917   those applicable to HTTP in general <xref target="Part1"/>.
918</t>
919</section>
920
921<section title="Acknowledgments" anchor="ack">
922<t>
923   Most of the specification of ranges is based on work originally done
924   by Ari Luotonen and John Franks, with additional input from Steve
925   Zilles, Daniel W. Connolly, Roy T. Fielding, Jim Gettys, Martin Hamilton,
926   Koen Holtman, Shel Kaplan, Paul Leach, Alex Lopez-Ortiz, Larry Masinter,
927   Jeff Mogul, Lou Montulli, David W. Morris, Luigi Rizzo, and Bill Weihl.
928</t>
929</section>
930</middle>
931<back>
932
933<references title="Normative References">
934
935<reference anchor="Part1">
936  <front>
937    <title abbrev="HTTP/1.1">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</title>
938    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
939      <organization abbrev="Day Software">Day Software</organization>
940      <address><email>fielding@gbiv.com</email></address>
941    </author>
942    <author initials="J." surname="Gettys" fullname="Jim Gettys">
943      <organization>One Laptop per Child</organization>
944      <address><email>jg@laptop.org</email></address>
945    </author>
946    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
947      <organization abbrev="HP">Hewlett-Packard Company</organization>
948      <address><email>JeffMogul@acm.org</email></address>
949    </author>
950    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
951      <organization abbrev="Microsoft">Microsoft Corporation</organization>
952      <address><email>henrikn@microsoft.com</email></address>
953    </author>
954    <author initials="L." surname="Masinter" fullname="Larry Masinter">
955      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
956      <address><email>LMM@acm.org</email></address>
957    </author>
958    <author initials="P." surname="Leach" fullname="Paul J. Leach">
959      <organization abbrev="Microsoft">Microsoft Corporation</organization>
960      <address><email>paulle@microsoft.com</email></address>
961    </author>
962    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
963      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
964      <address><email>timbl@w3.org</email></address>
965    </author>
966    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
967      <organization abbrev="W3C">World Wide Web Consortium</organization>
968      <address><email>ylafon@w3.org</email></address>
969    </author>
970    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
971      <organization abbrev="greenbytes">greenbytes GmbH</organization>
972      <address><email>julian.reschke@greenbytes.de</email></address>
973    </author>
974    <date month="March" year="2010"/>
975  </front>
976  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-09"/>
977 
978</reference>
979
980<reference anchor="Part3">
981  <front>
982    <title abbrev="HTTP/1.1">HTTP/1.1, part 3: Message Payload and Content Negotiation</title>
983    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
984      <organization abbrev="Day Software">Day Software</organization>
985      <address><email>fielding@gbiv.com</email></address>
986    </author>
987    <author initials="J." surname="Gettys" fullname="Jim Gettys">
988      <organization>One Laptop per Child</organization>
989      <address><email>jg@laptop.org</email></address>
990    </author>
991    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
992      <organization abbrev="HP">Hewlett-Packard Company</organization>
993      <address><email>JeffMogul@acm.org</email></address>
994    </author>
995    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
996      <organization abbrev="Microsoft">Microsoft Corporation</organization>
997      <address><email>henrikn@microsoft.com</email></address>
998    </author>
999    <author initials="L." surname="Masinter" fullname="Larry Masinter">
1000      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1001      <address><email>LMM@acm.org</email></address>
1002    </author>
1003    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1004      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1005      <address><email>paulle@microsoft.com</email></address>
1006    </author>
1007    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1008      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1009      <address><email>timbl@w3.org</email></address>
1010    </author>
1011    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1012      <organization abbrev="W3C">World Wide Web Consortium</organization>
1013      <address><email>ylafon@w3.org</email></address>
1014    </author>
1015    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1016      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1017      <address><email>julian.reschke@greenbytes.de</email></address>
1018    </author>
1019    <date month="March" year="2010"/>
1020  </front>
1021  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p3-payload-09"/>
1022 
1023</reference>
1024
1025<reference anchor="Part4">
1026  <front>
1027    <title abbrev="HTTP/1.1">HTTP/1.1, part 4: Conditional Requests</title>
1028    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1029      <organization abbrev="Day Software">Day Software</organization>
1030      <address><email>fielding@gbiv.com</email></address>
1031    </author>
1032    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1033      <organization>One Laptop per Child</organization>
1034      <address><email>jg@laptop.org</email></address>
1035    </author>
1036    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1037      <organization abbrev="HP">Hewlett-Packard Company</organization>
1038      <address><email>JeffMogul@acm.org</email></address>
1039    </author>
1040    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1041      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1042      <address><email>henrikn@microsoft.com</email></address>
1043    </author>
1044    <author initials="L." surname="Masinter" fullname="Larry Masinter">
1045      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1046      <address><email>LMM@acm.org</email></address>
1047    </author>
1048    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1049      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1050      <address><email>paulle@microsoft.com</email></address>
1051    </author>
1052    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1053      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1054      <address><email>timbl@w3.org</email></address>
1055    </author>
1056    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1057      <organization abbrev="W3C">World Wide Web Consortium</organization>
1058      <address><email>ylafon@w3.org</email></address>
1059    </author>
1060    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1061      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1062      <address><email>julian.reschke@greenbytes.de</email></address>
1063    </author>
1064    <date month="March" year="2010"/>
1065  </front>
1066  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p4-conditional-09"/>
1067 
1068</reference>
1069
1070<reference anchor="Part6">
1071  <front>
1072    <title abbrev="HTTP/1.1">HTTP/1.1, part 6: Caching</title>
1073    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1074      <organization abbrev="Day Software">Day Software</organization>
1075      <address><email>fielding@gbiv.com</email></address>
1076    </author>
1077    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1078      <organization>One Laptop per Child</organization>
1079      <address><email>jg@laptop.org</email></address>
1080    </author>
1081    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1082      <organization abbrev="HP">Hewlett-Packard Company</organization>
1083      <address><email>JeffMogul@acm.org</email></address>
1084    </author>
1085    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1086      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1087      <address><email>henrikn@microsoft.com</email></address>
1088    </author>
1089    <author initials="L." surname="Masinter" fullname="Larry Masinter">
1090      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1091      <address><email>LMM@acm.org</email></address>
1092    </author>
1093    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1094      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1095      <address><email>paulle@microsoft.com</email></address>
1096    </author>
1097    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1098      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1099      <address><email>timbl@w3.org</email></address>
1100    </author>
1101    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1102      <organization abbrev="W3C">World Wide Web Consortium</organization>
1103      <address><email>ylafon@w3.org</email></address>
1104    </author>
1105    <author initials="M." surname="Nottingham" fullname="Mark Nottingham" role="editor">
1106      <address><email>mnot@mnot.net</email></address>
1107    </author>
1108    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1109      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1110      <address><email>julian.reschke@greenbytes.de</email></address>
1111    </author>
1112    <date month="March" year="2010"/>
1113  </front>
1114  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-09"/>
1115 
1116</reference>
1117
1118<reference anchor="RFC2046">
1119  <front>
1120    <title abbrev="Media Types">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</title>
1121    <author initials="N." surname="Freed" fullname="Ned Freed">
1122      <organization>Innosoft International, Inc.</organization>
1123      <address><email>ned@innosoft.com</email></address>
1124    </author>
1125    <author initials="N." surname="Borenstein" fullname="Nathaniel S. Borenstein">
1126      <organization>First Virtual Holdings</organization>
1127      <address><email>nsb@nsb.fv.com</email></address>
1128    </author>
1129    <date month="November" year="1996"/>
1130  </front>
1131  <seriesInfo name="RFC" value="2046"/>
1132</reference>
1133
1134<reference anchor="RFC2119">
1135  <front>
1136    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
1137    <author initials="S." surname="Bradner" fullname="Scott Bradner">
1138      <organization>Harvard University</organization>
1139      <address><email>sob@harvard.edu</email></address>
1140    </author>
1141    <date month="March" year="1997"/>
1142  </front>
1143  <seriesInfo name="BCP" value="14"/>
1144  <seriesInfo name="RFC" value="2119"/>
1145</reference>
1146
1147<reference anchor="RFC5234">
1148  <front>
1149    <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title>
1150    <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor">
1151      <organization>Brandenburg InternetWorking</organization>
1152      <address>
1153        <email>dcrocker@bbiw.net</email>
1154      </address> 
1155    </author>
1156    <author initials="P." surname="Overell" fullname="Paul Overell">
1157      <organization>THUS plc.</organization>
1158      <address>
1159        <email>paul.overell@thus.net</email>
1160      </address>
1161    </author>
1162    <date month="January" year="2008"/>
1163  </front>
1164  <seriesInfo name="STD" value="68"/>
1165  <seriesInfo name="RFC" value="5234"/>
1166</reference>
1167
1168</references>
1169
1170<references title="Informative References">
1171
1172<reference anchor="RFC2616">
1173  <front>
1174    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
1175    <author initials="R." surname="Fielding" fullname="R. Fielding">
1176      <organization>University of California, Irvine</organization>
1177      <address><email>fielding@ics.uci.edu</email></address>
1178    </author>
1179    <author initials="J." surname="Gettys" fullname="J. Gettys">
1180      <organization>W3C</organization>
1181      <address><email>jg@w3.org</email></address>
1182    </author>
1183    <author initials="J." surname="Mogul" fullname="J. Mogul">
1184      <organization>Compaq Computer Corporation</organization>
1185      <address><email>mogul@wrl.dec.com</email></address>
1186    </author>
1187    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
1188      <organization>MIT Laboratory for Computer Science</organization>
1189      <address><email>frystyk@w3.org</email></address>
1190    </author>
1191    <author initials="L." surname="Masinter" fullname="L. Masinter">
1192      <organization>Xerox Corporation</organization>
1193      <address><email>masinter@parc.xerox.com</email></address>
1194    </author>
1195    <author initials="P." surname="Leach" fullname="P. Leach">
1196      <organization>Microsoft Corporation</organization>
1197      <address><email>paulle@microsoft.com</email></address>
1198    </author>
1199    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
1200      <organization>W3C</organization>
1201      <address><email>timbl@w3.org</email></address>
1202    </author>
1203    <date month="June" year="1999"/>
1204  </front>
1205  <seriesInfo name="RFC" value="2616"/>
1206</reference>
1207
1208<reference anchor="RFC3864">
1209  <front>
1210    <title>Registration Procedures for Message Header Fields</title>
1211    <author initials="G." surname="Klyne" fullname="G. Klyne">
1212      <organization>Nine by Nine</organization>
1213      <address><email>GK-IETF@ninebynine.org</email></address>
1214    </author>
1215    <author initials="M." surname="Nottingham" fullname="M. Nottingham">
1216      <organization>BEA Systems</organization>
1217      <address><email>mnot@pobox.com</email></address>
1218    </author>
1219    <author initials="J." surname="Mogul" fullname="J. Mogul">
1220      <organization>HP Labs</organization>
1221      <address><email>JeffMogul@acm.org</email></address>
1222    </author>
1223    <date year="2004" month="September"/>
1224  </front>
1225  <seriesInfo name="BCP" value="90"/>
1226  <seriesInfo name="RFC" value="3864"/>
1227</reference>
1228
1229<reference anchor="RFC4288">
1230  <front>
1231    <title>Media Type Specifications and Registration Procedures</title>
1232    <author initials="N." surname="Freed" fullname="N. Freed">
1233      <organization>Sun Microsystems</organization>
1234      <address>
1235        <email>ned.freed@mrochek.com</email>
1236      </address>
1237    </author>
1238    <author initials="J." surname="Klensin" fullname="J. Klensin">
1239      <address>
1240        <email>klensin+ietf@jck.com</email>
1241      </address>
1242    </author>
1243    <date year="2005" month="December"/>
1244  </front>
1245  <seriesInfo name="BCP" value="13"/>
1246  <seriesInfo name="RFC" value="4288"/>
1247</reference>
1248
1249</references>
1250
1251<section title="Internet Media Type multipart/byteranges" anchor="internet.media.type.multipart.byteranges">
1252<iref item="Media Type" subitem="multipart/byteranges" primary="true"/>
1253<iref item="multipart/byteranges Media Type" primary="true"/>
1254<t>
1255   When an HTTP 206 (Partial Content) response message includes the
1256   content of multiple ranges (a response to a request for multiple
1257   non-overlapping ranges), these are transmitted as a multipart
1258   message-body (<xref target="RFC2046"/>, Section 5.1). The media type for this purpose is called
1259   "multipart/byteranges".  The following is to be registered with IANA <xref target="RFC4288"/>.
1260</t>
1261<t><list>
1262  <t>
1263    Note: Despite the name "multipart/byteranges" is not limited to the byte ranges only.
1264  </t>
1265</list></t>
1266<t>
1267   The multipart/byteranges media type includes one or more parts, each
1268   with its own Content-Type and Content-Range fields. The required
1269   boundary parameter specifies the boundary string used to separate
1270   each body-part.
1271</t>
1272<t>
1273  <list style="hanging">
1274    <t hangText="Type name:">
1275      multipart
1276    </t>
1277    <t hangText="Subtype name:">
1278      byteranges
1279    </t>
1280    <t hangText="Required parameters:">
1281      boundary
1282    </t>
1283    <t hangText="Optional parameters:">
1284      none
1285    </t>
1286    <t hangText="Encoding considerations:">
1287      only "7bit", "8bit", or "binary" are permitted
1288    </t>
1289    <t hangText="Security considerations:">
1290      none
1291    </t>
1292    <t hangText="Interoperability considerations:">
1293      none
1294    </t>
1295    <t hangText="Published specification:">
1296      This specification (see <xref target="internet.media.type.multipart.byteranges"/>).
1297    </t>
1298    <t hangText="Applications that use this media type:">
1299    </t>
1300    <t hangText="Additional information:">
1301      <list style="hanging">
1302        <t hangText="Magic number(s):">none</t>
1303        <t hangText="File extension(s):">none</t>
1304        <t hangText="Macintosh file type code(s):">none</t>
1305      </list>
1306    </t>
1307    <t hangText="Person and email address to contact for further information:">
1308      See Authors Section.
1309    </t>
1310    <t hangText="Intended usage:">
1311      COMMON
1312    </t>
1313    <t hangText="Restrictions on usage:">
1314      none
1315    </t>
1316    <t hangText="Author/Change controller:">
1317      IESG
1318    </t>
1319  </list>
1320</t>
1321<figure><preamble>
1322   For example:
1323</preamble><artwork type="example"><![CDATA[
1324  HTTP/1.1 206 Partial Content
1325  Date: Wed, 15 Nov 1995 06:25:24 GMT
1326  Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
1327  Content-type: multipart/byteranges; boundary=THIS_STRING_SEPARATES
1328 
1329  --THIS_STRING_SEPARATES
1330  Content-type: application/pdf
1331  Content-range: bytes 500-999/8000
1332 
1333  ...the first range...
1334  --THIS_STRING_SEPARATES
1335  Content-type: application/pdf
1336  Content-range: bytes 7000-7999/8000
1337 
1338  ...the second range
1339  --THIS_STRING_SEPARATES--
1340]]></artwork></figure>
1341<figure><preamble>
1342   Other example:
1343</preamble>
1344<artwork type="example"><![CDATA[
1345  HTTP/1.1 206 Partial Content
1346  Date: Tue, 14 Nov 1995 06:25:24 GMT
1347  Last-Modified: Tue, 14 July 04:58:08 GMT
1348  Content-type: multipart/byteranges; boundary=THIS_STRING_SEPARATES
1349 
1350  --THIS_STRING_SEPARATES
1351  Content-type: video/example
1352  Content-range: exampleunit 1.2-4.3/25
1353 
1354  ...the first range...
1355  --THIS_STRING_SEPARATES
1356  Content-type: video/example
1357  Content-range: exampleunit 11.2-14.3/25
1358 
1359  ...the second range
1360  --THIS_STRING_SEPARATES--
1361]]></artwork>
1362</figure>
1363<t>
1364      Notes:
1365  <list style="numbers">
1366      <t>Additional CRLFs may precede the first boundary string in the
1367         entity.</t>
1368
1369      <t>Although <xref target="RFC2046"/> permits the boundary string to be
1370         quoted, some existing implementations handle a quoted boundary
1371         string incorrectly.</t>
1372
1373      <t>A number of browsers and servers were coded to an early draft
1374         of the byteranges specification to use a media type of
1375         multipart/x-byteranges<iref item="multipart/x-byteranges Media Type"/><iref item="Media Type" subitem="multipart/x-byteranges"/>, which is almost, but not quite
1376         compatible with the version documented in HTTP/1.1.</t>
1377  </list>
1378</t>
1379</section>
1380
1381<section title="Compatibility with Previous Versions" anchor="compatibility">
1382<section title="Changes from RFC 2068" anchor="changes.from.rfc.2068">
1383<t>
1384   Transfer-coding and message lengths all interact in ways that
1385   required fixing exactly when chunked encoding is used (to allow for
1386   transfer encoding that may not be self delimiting); it was important
1387   to straighten out exactly how message lengths are computed.
1388   (<xref target="header.content-range"/>,
1389   see also <xref target="Part1"/>, <xref target="Part3"/> and <xref target="Part6"/>)
1390</t>
1391<t>
1392   There are situations where a server (especially a proxy) does not
1393   know the full length of a response but is capable of serving a
1394   byterange request. We therefore need a mechanism to allow byteranges
1395   with a content-range not indicating the full length of the message.
1396   (<xref target="header.content-range"/>)
1397</t>
1398<t>
1399   Range request responses would become very verbose if all meta-data
1400   were always returned; by allowing the server to only send needed
1401   headers in a 206 response, this problem can be avoided.
1402   (Section <xref target="status.206" format="counter"/>
1403   and <xref target="header.if-range" format="counter"/>)
1404</t>
1405<t>
1406   Fix problem with unsatisfiable range requests; there are two cases:
1407   syntactic problems, and range doesn't exist in the document. The 416
1408   status code was needed to resolve this ambiguity needed to indicate
1409   an error for a byte range request that falls outside of the actual
1410   contents of a document. (Section <xref target="status.416" format="counter"/>, <xref target="header.content-range" format="counter"/>)
1411</t>
1412</section>
1413
1414<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
1415<t>
1416  Clarify that it is not ok to use a weak cache validator in a 206 response.
1417  (<xref target="status.206"/>)
1418</t>
1419<t>
1420  Clarify that multipart/byteranges can consist of a single part.
1421  (<xref target="internet.media.type.multipart.byteranges"/>)
1422</t>
1423
1424</section>
1425
1426</section>
1427
1428
1429<section title="Collected ABNF" anchor="collected.abnf">
1430<figure>
1431<artwork type="abnf" name="p5-range.parsed-abnf"><![CDATA[
1432Accept-Ranges = "Accept-Ranges:" OWS Accept-Ranges-v
1433Accept-Ranges-v = acceptable-ranges
1434
1435Content-Range = "Content-Range:" OWS Content-Range-v
1436Content-Range-v = content-range-spec
1437
1438HTTP-date = <HTTP-date, defined in [Part1], Section 6.1>
1439
1440If-Range = "If-Range:" OWS If-Range-v
1441If-Range-v = entity-tag / HTTP-date
1442
1443OWS = <OWS, defined in [Part1], Section 1.2.2>
1444
1445Range = "Range:" OWS Range-v
1446Range-v = byte-ranges-specifier / other-ranges-specifier
1447
1448acceptable-ranges = ( *( "," OWS ) range-unit *( OWS "," [ OWS
1449 range-unit ] ) ) / "none"
1450
1451byte-content-range-spec = bytes-unit SP byte-range-resp-spec "/" (
1452 instance-length / "*" )
1453byte-range-resp-spec = ( first-byte-pos "-" last-byte-pos ) / "*"
1454byte-range-set = ( *( "," OWS ) byte-range-spec ) / (
1455 suffix-byte-range-spec *( OWS "," [ ( OWS byte-range-spec ) /
1456 suffix-byte-range-spec ] ) )
1457byte-range-spec = first-byte-pos "-" [ last-byte-pos ]
1458byte-ranges-specifier = bytes-unit "=" byte-range-set
1459bytes-unit = "bytes"
1460
1461content-range-spec = byte-content-range-spec /
1462 other-content-range-spec
1463
1464entity-tag = <entity-tag, defined in [Part4], Section 2>
1465
1466first-byte-pos = 1*DIGIT
1467
1468instance-length = 1*DIGIT
1469
1470last-byte-pos = 1*DIGIT
1471
1472other-content-range-spec = other-range-unit SP other-range-resp-spec
1473other-range-resp-spec = *CHAR
1474other-range-set = 1*CHAR
1475other-range-unit = token
1476other-ranges-specifier = other-range-unit "=" other-range-set
1477
1478range-unit = bytes-unit / other-range-unit
1479
1480suffix-byte-range-spec = "-" suffix-length
1481suffix-length = 1*DIGIT
1482
1483token = <token, defined in [Part1], Section 1.2.2>
1484]]></artwork>
1485</figure>
1486<figure><preamble>ABNF diagnostics:</preamble><artwork type="inline"><![CDATA[
1487; Accept-Ranges defined but not used
1488; Content-Range defined but not used
1489; If-Range defined but not used
1490; Range defined but not used
1491]]></artwork></figure></section>
1492
1493
1494
1495<section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log">
1496
1497<section title="Since RFC2616">
1498<t>
1499  Extracted relevant partitions from <xref target="RFC2616"/>.
1500</t>
1501</section>
1502
1503<section title="Since draft-ietf-httpbis-p5-range-00">
1504<t>
1505  Closed issues:
1506  <list style="symbols"> 
1507    <t>
1508      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/18"/>:
1509      "Cache validators in 206 responses"
1510      (<eref target="http://purl.org/NET/http-errata#ifrange206"/>)
1511    </t>
1512    <t>
1513      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/35"/>:
1514      "Normative and Informative references"
1515    </t>
1516    <t>
1517      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/86"/>:
1518      "Normative up-to-date references"
1519    </t>
1520  </list>
1521</t>
1522</section>
1523
1524<section title="Since draft-ietf-httpbis-p5-range-01">
1525<t>
1526  Closed issues:
1527  <list style="symbols"> 
1528    <t>
1529      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/55"/>:
1530      "Updating to RFC4288"
1531    </t>
1532  </list>
1533</t>
1534<t>
1535  Ongoing work on ABNF conversion (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/36"/>):
1536  <list style="symbols"> 
1537    <t>
1538      Add explicit references to BNF syntax and rules imported from other parts of the specification.
1539    </t>
1540  </list>
1541</t>
1542</section>
1543
1544<section title="Since draft-ietf-httpbis-p5-range-02" anchor="changes.since.02">
1545<t>
1546  Ongoing work on IANA Message Header Registration (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/40"/>):
1547  <list style="symbols"> 
1548    <t>
1549      Reference RFC 3984, and update header registrations for headers defined
1550      in this document.
1551    </t>
1552  </list>
1553</t>
1554</section>
1555
1556<section title="Since draft-ietf-httpbis-p5-range-03" anchor="changes.since.03">
1557<t>
1558</t>
1559</section>
1560
1561<section title="Since draft-ietf-httpbis-p5-range-04" anchor="changes.since.04">
1562<t>
1563  Closed issues:
1564  <list style="symbols"> 
1565    <t>
1566      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/133"/>:
1567      "multipart/byteranges minimum number of parts"
1568    </t>
1569  </list>
1570</t>
1571<t>
1572  Ongoing work on ABNF conversion (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/36"/>):
1573  <list style="symbols"> 
1574    <t>
1575      Use "/" instead of "|" for alternatives.
1576    </t>
1577    <t>
1578      Introduce new ABNF rules for "bad" whitespace ("BWS"), optional
1579      whitespace ("OWS") and required whitespace ("RWS").
1580    </t>
1581    <t>
1582      Rewrite ABNFs to spell out whitespace rules, factor out
1583      header value format definitions.
1584    </t>
1585  </list>
1586</t>
1587</section>
1588
1589<section title="Since draft-ietf-httpbis-p5-range-05" anchor="changes.since.05">
1590<t>
1591  Closed issues:
1592  <list style="symbols"> 
1593    <t>
1594      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/142"/>:
1595      "State base for *-byte-pos and suffix-length"
1596    </t>
1597  </list>
1598</t>
1599<t>
1600  Ongoing work on Custom Ranges (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/85"/>):
1601  <list style="symbols"> 
1602    <t>
1603      Remove bias in favor of byte ranges; allow custom ranges in ABNF.
1604    </t>
1605  </list>
1606</t>
1607<t>
1608  Final work on ABNF conversion (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/36"/>):
1609  <list style="symbols"> 
1610    <t>
1611      Add appendix containing collected and expanded ABNF, reorganize ABNF introduction.
1612    </t>
1613  </list>
1614</t>
1615</section>
1616
1617<section title="Since draft-ietf-httpbis-p5-range-06" anchor="changes.since.06">
1618<t>
1619  Closed issues:
1620  <list style="symbols"> 
1621    <t>
1622      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/161"/>:
1623      "base for numeric protocol elements"
1624    </t>
1625  </list>
1626</t>
1627</section>
1628
1629<section title="Since draft-ietf-httpbis-p5-range-07" anchor="changes.since.07">
1630<t>
1631  Closed issues:
1632  <list style="symbols">
1633    <t>
1634      Fixed discrepancy in the If-Range definition about allowed validators.
1635    </t>
1636    <t>
1637      <eref target="http://trac.tools.ietf.org/wg/httpbis/trac/ticket/150"/>: "multipart/byteranges for custom range units"
1638    </t>
1639    <t>
1640      <eref target="http://trac.tools.ietf.org/wg/httpbis/trac/ticket/151"/>: "range unit missing from other-ranges-specifier in Range header"
1641    </t>
1642    <t>
1643      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/198"/>:
1644      "move IANA registrations for optional status codes"
1645    </t>
1646  </list>
1647</t>
1648</section>
1649
1650<section title="Since draft-ietf-httpbis-p5-range-08" anchor="changes.since.08">
1651<t>
1652  No significant changes.
1653</t>
1654</section>
1655
1656</section>
1657
1658</back>
1659</rfc>
Note: See TracBrowser for help on using the repository browser.