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

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

align sbatracts and put a paragraph break inside for readability

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