source: draft-ietf-httpbis/15/draft-ietf-httpbis-p5-range-15.xml @ 1391

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

Fix "none yet" entries in -15 change log entries, update -latest accordingly.

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