source: draft-ietf-httpbis/latest/p5-range.xml @ 1258

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

regen collected ABNF after move of entity-tag

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