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

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

reorganize ABNF introductions to match Part1 (related to #36)

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