source: draft-ietf-httpbis/10/draft-ietf-httpbis-p5-range-10.xml

Last change on this file was 1500, checked in by julian.reschke@…, 8 years ago

fix mime types

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