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

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

remove historical Acks (see #219)

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