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

Last change on this file since 1260 was 1260, checked in by fielding@…, 12 years ago

editorial: rearrange p4 a bit more to split discussion of last-modified
from that of entity-tags, move entity-tags definition within the ETag
header field, and introduce sections for requirements on generation
and comparison of each (separately). This roughly halves the
cognitive complexity of the existing descriptions and allows us
to get rid of a lot of duplication (with more to come).

Moved some stray requirements on range requests to p5.

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