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

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

fix line wrap in ABNF prose problem; update XSLT for collected ABNF to move diagnostics into separate figure

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