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

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

Remove bias in favor of byte ranges; allow custom ranges in ABNF. (related to #85)

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