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

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

(editorial) more cleanup in p5

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/xml
File size: 59.2 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<?xml-stylesheet type='text/xsl' href='../myxml2rfc.xslt'?>
3<!DOCTYPE rfc [
4  <!ENTITY MAY "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MAY</bcp14>">
5  <!ENTITY MUST "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST</bcp14>">
6  <!ENTITY MUST-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST NOT</bcp14>">
7  <!ENTITY OPTIONAL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>OPTIONAL</bcp14>">
8  <!ENTITY RECOMMENDED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>RECOMMENDED</bcp14>">
9  <!ENTITY REQUIRED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>REQUIRED</bcp14>">
10  <!ENTITY SHALL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL</bcp14>">
11  <!ENTITY SHALL-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL NOT</bcp14>">
12  <!ENTITY SHOULD "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD</bcp14>">
13  <!ENTITY SHOULD-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD NOT</bcp14>">
14  <!ENTITY ID-VERSION "latest">
15  <!ENTITY ID-MONTH "January">
16  <!ENTITY ID-YEAR "2013">
17  <!ENTITY Note "<x:h xmlns:x='http://purl.org/net/xml2rfc/ext'>Note:</x:h>">
18  <!ENTITY architecture               "<xref target='Part1' x:rel='#architecture' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
19  <!ENTITY conformance                "<xref target='Part1' x:rel='#conformance' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
20  <!ENTITY notation                   "<xref target='Part1' x:rel='#notation' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
21  <!ENTITY abnf-extension             "<xref target='Part1' x:rel='#abnf.extension' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
22  <!ENTITY acks                       "<xref target='Part1' x:rel='#acks' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
23  <!ENTITY whitespace                 "<xref target='Part1' x:rel='#whitespace' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
24  <!ENTITY field-components           "<xref target='Part1' x:rel='#field.components' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
25  <!ENTITY messaging                  "<xref target='Part1' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
26  <!ENTITY semantics                  "<xref target='Part2' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
27  <!ENTITY http-date                  "<xref target='Part2' x:rel='#http.date' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
28  <!ENTITY representation             "<xref target='Part2' x:rel='#representations' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
29  <!ENTITY entity-tags                "<xref target='Part4' x:rel='#header.etag' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
30  <!ENTITY weak-and-strong-validators "<xref target='Part4' x:rel='#weak.and.strong.validators' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
31  <!ENTITY lastmod-comparison         "<xref target='Part4' x:rel='#lastmod.comparison' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
32  <!ENTITY p6-heuristic               "<xref target='Part6' x:rel='#heuristic.freshness' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
33]>
34<?rfc toc="yes" ?>
35<?rfc symrefs="yes" ?>
36<?rfc sortrefs="yes" ?>
37<?rfc compact="yes"?>
38<?rfc subcompact="no" ?>
39<?rfc linkmailto="no" ?>
40<?rfc editing="no" ?>
41<?rfc comments="yes"?>
42<?rfc inline="yes"?>
43<?rfc rfcedstyle="yes"?>
44<?rfc-ext allow-markup-in-artwork="yes" ?>
45<?rfc-ext include-references-in-index="yes" ?>
46<rfc obsoletes="2616" category="std" x:maturity-level="proposed"
47     ipr="pre5378Trust200902" docName="draft-ietf-httpbis-p5-range-&ID-VERSION;"
48     xmlns:x='http://purl.org/net/xml2rfc/ext'>
49<x:link rel="prev" basename="p4-conditional"/>
50<x:link rel="next" basename="p6-cache"/>
51<x:feedback template="mailto:ietf-http-wg@w3.org?subject={docname},%20%22{section}%22&amp;body=&lt;{ref}&gt;:"/>
52<front>
53
54  <title abbrev="HTTP/1.1 Range Requests">Hypertext Transfer Protocol (HTTP/1.1): Range Requests</title>
55
56  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
57    <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
58    <address>
59      <postal>
60        <street>345 Park Ave</street>
61        <city>San Jose</city>
62        <region>CA</region>
63        <code>95110</code>
64        <country>USA</country>
65      </postal>
66      <email>fielding@gbiv.com</email>
67      <uri>http://roy.gbiv.com/</uri>
68    </address>
69  </author>
70
71  <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
72    <organization abbrev="W3C">World Wide Web Consortium</organization>
73    <address>
74      <postal>
75        <street>W3C / ERCIM</street>
76        <street>2004, rte des Lucioles</street>
77        <city>Sophia-Antipolis</city>
78        <region>AM</region>
79        <code>06902</code>
80        <country>France</country>
81      </postal>
82      <email>ylafon@w3.org</email>
83      <uri>http://www.raubacapeu.net/people/yves/</uri>
84    </address>
85  </author>
86
87  <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
88    <organization abbrev="greenbytes">greenbytes GmbH</organization>
89    <address>
90      <postal>
91        <street>Hafenweg 16</street>
92        <city>Muenster</city><region>NW</region><code>48155</code>
93        <country>Germany</country>
94      </postal>
95      <email>julian.reschke@greenbytes.de</email>
96      <uri>http://greenbytes.de/tech/webdav/</uri>
97    </address>
98  </author>
99
100  <date month="&ID-MONTH;" year="&ID-YEAR;"/>
101  <workgroup>HTTPbis Working Group</workgroup>
102
103<abstract>
104<t>
105   The Hypertext Transfer Protocol (HTTP) is an application-level protocol for
106   distributed, collaborative, hypertext information systems. This document
107   defines range requests and the rules for constructing and combining
108   responses to those requests.
109</t>
110</abstract>
111
112<note title="Editorial Note (To be removed by RFC Editor)">
113  <t>
114    Discussion of this draft takes place on the HTTPBIS working group
115    mailing list (ietf-http-wg@w3.org), which is archived at
116    <eref target="http://lists.w3.org/Archives/Public/ietf-http-wg/"/>.
117  </t>
118  <t>
119    The current issues list is at
120    <eref target="http://tools.ietf.org/wg/httpbis/trac/report/3"/> and related
121    documents (including fancy diffs) can be found at
122    <eref target="http://tools.ietf.org/wg/httpbis/"/>.
123  </t>
124  <t>
125    The changes in this draft are summarized in <xref target="changes.since.21"/>.
126  </t>
127</note>
128</front>
129<middle>
130<section title="Introduction" anchor="introduction">
131<t>
132   Hypertext Transfer Protocol (HTTP) clients often encounter interrupted data
133   transfers as a result of canceled requests or dropped connections. When a
134   client has stored a partial representation, it is desirable to request the
135   remainder of that representation in a subsequent request rather than
136   transfer the entire representation. Likewise, devices with limited local
137   storage might benefit from being able to request only a subset of a larger
138   representation, such as a single page of a very large document, or the
139   dimensions of an embedded image.
140</t>
141<t>
142   This document defines HTTP/1.1 range requests, partial responses, and the
143   multipart/byteranges media type, obsoleting those parts previously defined
144   in <xref target="RFC2616"/>. Range requests are an &OPTIONAL; feature
145   of HTTP, designed so that recipients not implementing this feature (or not
146   supporting it for the target resource) can respond as if it is a normal
147   GET request without impacting interoperability. Partial responses are
148   indicated by a distinct status code to not be mistaken for full responses
149   by caches that might not implement the feature.
150</t>
151<t>
152   Although the range request mechanism is designed to allow for
153   extensible range types, this specification only defines requests for
154   byte ranges.
155</t>
156
157<section title="Conformance and Error Handling" anchor="conformance">
158<t>
159   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
160   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
161   document are to be interpreted as described in <xref target="RFC2119"/>.
162</t>
163<t>
164   Conformance criteria and considerations regarding error handling
165   are defined in &conformance;.
166</t>
167</section>
168
169<section title="Syntax Notation" anchor="notation">
170<t>
171   This specification uses the Augmented Backus-Naur Form (ABNF) notation
172   of <xref target="RFC5234"/> with the list rule extension defined in
173   &notation;. <xref target="imported.abnf"/> describes rules imported from
174   other documents. <xref target="collected.abnf"/> shows the collected ABNF
175   with the list rule expanded.
176</t>
177</section>
178</section>
179
180
181<section title="Range Units" anchor="range.units">
182  <x:anchor-alias value="range-unit"/>
183  <x:anchor-alias value="range unit"/>
184<t>
185   A representation can be partitioned into subranges according to various
186   structural units, depending on the structure inherent in the
187   representation's media type. This "<x:dfn>range unit</x:dfn>" is used
188   in the <x:ref>Accept-Ranges</x:ref> (<xref target="header.accept-ranges"/>)
189   response header field to advertise support for range requests, the
190   <x:ref>Range</x:ref> (<xref target="header.range"/>) request header field
191   to delineate the parts of a representation that are requested, and the
192   <x:ref>Content-Range</x:ref> (<xref target="header.content-range"/>)
193   payload header field to describe which part of a representation is being
194   transferred.
195</t>
196<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="range-unit"/><iref item="Grammar" subitem="bytes-unit"/><iref item="Grammar" subitem="other-range-unit"/>
197  <x:ref>range-unit</x:ref>       = <x:ref>bytes-unit</x:ref> / <x:ref>other-range-unit</x:ref>
198</artwork></figure>
199
200<section title="Byte Ranges" anchor="byte.ranges">
201  <x:anchor-alias value="bytes-unit"/>
202<t>
203   Since representation data is transferred in payloads as a sequence of
204   octets, a byte range is a meaningful substructure for any representation
205   transferable over HTTP (&representation;). We define the "bytes" range
206   unit for expressing subranges of the data's octet sequence.
207</t>
208<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="bytes-unit"/>
209  <x:ref>bytes-unit</x:ref>       = "bytes"
210</artwork></figure>
211<t anchor="rule.ranges-specifier">
212  <x:anchor-alias value="byte-range-set"/>
213  <x:anchor-alias value="byte-range-spec"/>
214  <x:anchor-alias value="byte-ranges-specifier"/>
215  <x:anchor-alias value="first-byte-pos"/>
216  <x:anchor-alias value="last-byte-pos"/>
217  <x:anchor-alias value="ranges-specifier"/>
218  <x:anchor-alias value="suffix-byte-range-spec"/>
219  <x:anchor-alias value="suffix-length"/>
220   A byte range operation &MAY; specify a single range of bytes, or a set
221   of ranges within a single representation.
222</t>
223<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"/>
224  <x:ref>byte-ranges-specifier</x:ref> = <x:ref>bytes-unit</x:ref> "=" <x:ref>byte-range-set</x:ref>
225  <x:ref>byte-range-set</x:ref>  = 1#( <x:ref>byte-range-spec</x:ref> / <x:ref>suffix-byte-range-spec</x:ref> )
226  <x:ref>byte-range-spec</x:ref> = <x:ref>first-byte-pos</x:ref> "-" [ <x:ref>last-byte-pos</x:ref> ]
227  <x:ref>first-byte-pos</x:ref>  = 1*<x:ref>DIGIT</x:ref>
228  <x:ref>last-byte-pos</x:ref>   = 1*<x:ref>DIGIT</x:ref>
229</artwork></figure>
230<t>
231   The <x:ref>first-byte-pos</x:ref> value in a <x:ref>byte-range-spec</x:ref>
232   gives the byte-offset of the first byte in a range.
233   The <x:ref>last-byte-pos</x:ref> value gives the byte-offset of the last
234   byte in the range; that is, the byte positions specified are inclusive.
235   Byte offsets start at zero.
236</t>
237<t>
238   Examples of <x:ref>byte-ranges-specifier</x:ref> values:
239  <list style="symbols">
240     <t>The first 500 bytes (byte offsets 0-499, inclusive):
241<figure><artwork type="example" x:indent-with="   ">
242  bytes=0-499
243</artwork></figure>
244    </t>
245     <t>The second 500 bytes (byte offsets 500-999, inclusive):
246<figure><artwork type="example" x:indent-with="   ">
247  bytes=500-999
248</artwork></figure>
249    </t>
250  </list>
251</t>
252<t>
253   A <x:ref>byte-range-spec</x:ref> is invalid if the
254   <x:ref>last-byte-pos</x:ref> value is present and less than the
255   <x:ref>first-byte-pos</x:ref>.
256</t>
257<t>
258   A client can limit the number of bytes requested without knowing the size
259   of the selected representation.
260   If the <x:ref>last-byte-pos</x:ref> value is absent, or if the value is
261   greater than or equal to the current length of the representation data, the
262   byte range is interpreted as the remainder of the representation (i.e., the
263   server replaces the value of <x:ref>last-byte-pos</x:ref> with a value that
264   is one less than the current length of the selected representation).
265</t>
266<t>
267   A client can request the last N bytes of the selected representation using
268   a <x:ref>suffix-byte-range-spec</x:ref>.
269</t>
270<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="suffix-byte-range-spec"/><iref primary="true" item="Grammar" subitem="suffix-length"/>
271  <x:ref>suffix-byte-range-spec</x:ref> = "-" <x:ref>suffix-length</x:ref>
272  <x:ref>suffix-length</x:ref> = 1*<x:ref>DIGIT</x:ref>
273</artwork></figure>
274<t>
275   If the selected representation is shorter than the specified
276   <x:ref>suffix-length</x:ref>, the entire representation is used.
277   For example (assuming a representation of length 10000):
278  <list style="symbols">
279     <t>The final 500 bytes (byte offsets 9500-9999, inclusive):
280<figure><artwork type="example" x:indent-with="   ">
281  bytes=-500
282</artwork></figure>
283    Or:
284<figure><artwork type="example" x:indent-with="   ">
285  bytes=9500-
286</artwork></figure>
287    </t>
288     <t>The first and last bytes only (bytes 0 and 9999):
289<figure><artwork type="example" x:indent-with="   ">
290  bytes=0-0,-1
291</artwork></figure>
292     </t>
293     <t>Other valid (but not canonical) specifications of the second 500
294        bytes (byte offsets 500-999, inclusive):
295<figure><artwork type="example" x:indent-with="   ">
296  bytes=500-600,601-999
297  bytes=500-700,601-999
298</artwork></figure>
299     </t>
300  </list>
301</t>
302<t>
303   If a valid <x:ref>byte-range-set</x:ref> includes at least one
304   <x:ref>byte-range-spec</x:ref> with a <x:ref>first-byte-pos</x:ref> that is
305   less than the current length of the representation, or at least one
306   <x:ref>suffix-byte-range-spec</x:ref> with a non-zero
307   <x:ref>suffix-length</x:ref>, then the <x:ref>byte-range-set</x:ref> is
308   satisfiable. Otherwise, the <x:ref>byte-range-set</x:ref> is unsatisfiable.
309</t>
310<t>
311   In the byte range syntax, <x:ref>first-byte-pos</x:ref>,
312   <x:ref>last-byte-pos</x:ref>, and <x:ref>suffix-length</x:ref> are
313   expressed as decimal number of octets. Since there is no predefined limit
314   to the length of a payload, recipients ought to anticipate potentially
315   large decimal numerals and prevent parsing errors due to integer conversion
316   overflows.
317</t>
318</section>
319
320<section title="Other Range Units" anchor="range.units.other">
321  <x:anchor-alias value="other-range-unit"/>
322<t>
323  Range units are intended to be extensible.  New range units ought to be
324  registered with IANA, as defined in <xref target="range.unit.registry"/>.
325</t>
326<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="other-range-unit"/>
327  <x:ref>other-range-unit</x:ref> = <x:ref>token</x:ref>
328</artwork></figure>
329</section>
330
331<section title="Accept-Ranges" anchor="header.accept-ranges">
332  <iref primary="true" item="Accept-Ranges header field" x:for-anchor=""/>
333  <x:anchor-alias value="Accept-Ranges"/>
334  <x:anchor-alias value="acceptable-ranges"/>
335<t>
336   The "Accept-Ranges" header field allows a server to indicate that it
337   supports range requests for the target resource.
338</t>
339<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Ranges"/><iref primary="true" item="Grammar" subitem="acceptable-ranges"/>
340  <x:ref>Accept-Ranges</x:ref>     = <x:ref>acceptable-ranges</x:ref>
341  <x:ref>acceptable-ranges</x:ref> = 1#<x:ref>range-unit</x:ref> / "none"
342</artwork></figure>
343<t>
344   Origin servers that support byte-range requests &MAY; send
345</t>
346<figure><artwork type="example">
347  Accept-Ranges: bytes
348</artwork></figure>
349<t>
350   but are not required to do so. Clients &MAY; generate range
351   requests without having received this header field for the resource
352   involved. Range units are defined in <xref target="range.units"/>.
353</t>
354<t>
355   Servers that do not support any kind of range request for the target
356   resource resource &MAY; send
357</t>
358<figure><artwork type="example">
359  Accept-Ranges: none
360</artwork></figure>
361<t>
362   to advise the client not to attempt a range request.
363</t>
364</section>
365</section>
366
367
368<section title="Range Requests" anchor="range.requests">
369<section title="Range" anchor="header.range">
370  <iref primary="true" item="Range header field" x:for-anchor=""/>
371  <x:anchor-alias value="Range"/>
372  <x:anchor-alias value="other-ranges-specifier"/>
373  <x:anchor-alias value="other-range-set"/>
374<t>
375   The "Range" header field on a GET request modifies the method semantics to
376   request transfer of only one or more subranges of the selected
377   representation data, rather than the entire selected representation data.
378</t>
379<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Range"/>
380  <x:ref>Range</x:ref> = <x:ref>byte-ranges-specifier</x:ref> / <x:ref>other-ranges-specifier</x:ref>
381  <x:ref>other-ranges-specifier</x:ref> = <x:ref>other-range-unit</x:ref> "=" <x:ref>other-range-set</x:ref>
382  <x:ref>other-range-set</x:ref> = 1*<x:ref>CHAR</x:ref>
383</artwork></figure>
384<t>
385   A server &MAY; ignore the Range header field. However, origin servers and
386   intermediate caches ought to support byte ranges when possible, since Range
387   supports efficient recovery from partially failed transfers and partial
388   retrieval of large representations. A server &MUST; ignore a Range header
389   field received with a request method other than GET.
390</t>
391<t>
392   An origin server &MUST; ignore a Range header field that contains a range
393   unit it does not understand. A proxy &MAY; either discard a Range header
394   field that contains a range unit it does not understand or pass it to the
395   next inbound server when forwarding the request.
396</t>
397<t>
398   The Range header field is evaluated after evaluating the preconditions of
399   <xref target="Part4"/> and only if the result of their evaluation is
400   leading toward a <x:ref>200 (OK)</x:ref> response. In other words, Range
401   is ignored when a conditional GET would result in a
402   <x:ref>304 (Not Modified)</x:ref> response.
403</t>
404<t>
405   The If-Range header field (<xref target="header.if-range"/>) can be used as
406   a precondition to applying the Range header field.
407</t>
408<t>
409   If all of the preconditions are true, the server supports the Range header
410   field for the target resource, and the specified range(s) are valid and
411   satisfiable (as defined in <xref target="byte.ranges"/>), the
412   server &SHOULD; send a <x:ref>206 (Partial Content)</x:ref> response with a
413   payload containing one or more partial representations that correspond to
414   the satisfiable ranges requested, as defined in
415   <xref target="range.response"/>.
416</t>
417<t>
418   If all of the preconditions are true, the server supports the Range header
419   field for the target resource, and the specified range(s) are invalid or
420   unsatisfiable, the server &SHOULD; send a
421   <x:ref>416 (Range Not Satisfiable)</x:ref> response.
422</t>
423</section>
424
425<section title="If-Range" anchor="header.if-range">
426  <iref primary="true" item="If-Range header field" x:for-anchor=""/>
427  <x:anchor-alias value="If-Range"/>
428<t>
429   If a client has a partial copy of a representation and wishes
430   to have an up-to-date copy of the entire representation, it could use the
431   <x:ref>Range</x:ref> header field with a conditional GET (using
432   either or both of <x:ref>If-Unmodified-Since</x:ref> and
433   <x:ref>If-Match</x:ref>.) However, if the condition fails because the
434   representation has been modified, the client would then have to make a
435   second request to obtain the entire current representation.
436</t>
437<t>
438   The "If-Range" header field allows a client to "short-circuit" the second
439   request. Informally, its meaning is: if the representation is unchanged,
440   send me the part(s) that I am requesting in Range; otherwise, send me the
441   entire representation.
442</t>
443<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Range"/>
444  <x:ref>If-Range</x:ref> = <x:ref>entity-tag</x:ref> / <x:ref>HTTP-date</x:ref>
445</artwork></figure>
446<t>
447   Clients &MUST-NOT; use an entity-tag marked as weak in an If-Range
448   field value and &MUST-NOT; use a <x:ref>Last-Modified</x:ref> date in an
449   If-Range field value unless it has no entity-tag for the representation and
450   the Last-Modified date it does have for the representation is strong
451   in the sense defined by &lastmod-comparison;.
452</t>
453<t>
454   A server that evaluates a conditional range request that is applicable
455   to one of its representations &MUST; evaluate the condition as false if
456   the entity-tag used as a validator is marked as weak or, when an HTTP-date
457   is used as the validator, if the date value is not strong in the sense
458   defined by &lastmod-comparison;. (A server can distinguish between a
459   valid HTTP-date and any form of entity-tag by examining the first
460   two characters.)
461</t>
462<t>
463   A client &MUST-NOT; generate an If-Range header field in a request that
464   does not contain a <x:ref>Range</x:ref> header field.
465   A server &MUST; ignore an If-Range header field received in a request that
466   does not contain a <x:ref>Range</x:ref> header field.
467   An origin server &MUST; ignore an If-Range header field received in a
468   request for a target resource that does not support Range requests.
469</t>
470<t>
471   If the validator given in the If-Range header field matches the current
472   validator for the selected representation of the target resource, then
473   the server &SHOULD; process the Range header field as requested.
474   If the validator does not match, then the server &MUST; ignore the
475   <x:ref>Range</x:ref> header field.
476</t>
477</section>
478</section>
479
480
481<section title="Responses to a Range Request" anchor="range.response">
482
483<section title="206 Partial Content" anchor="status.206">
484  <iref primary="true" item="206 Partial Content (status code)" x:for-anchor=""/>
485  <x:anchor-alias value="206"/>
486  <x:anchor-alias value="206 (Partial Content)"/>
487<t>
488   The <x:dfn>206 (Partial Content)</x:dfn> status code indicates that the
489   server is successfully fulfilling a range request for the target resource
490   by transferring one or more parts of the selected representation that
491   correspond to the satisfiable ranges found in the requests's
492   <x:ref>Range</x:ref> header field (<xref target="header.range"/>).
493</t>
494<t>
495   If a single part is being transferred, the server generating the 206
496   response &MUST; generate a <x:ref>Content-Range</x:ref> header field,
497   describing what range of the selected representation is enclosed, and a
498   payload consisting of the range. For example:
499</t>
500<figure><artwork type="message/http; msgtype=&#34;response&#34;" x:indent-with="  ">
501HTTP/1.1 206 Partial Content
502Date: Wed, 15 Nov 1995 06:25:24 GMT
503Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
504Content-Range: bytes 21010-47021/47022
505Content-Length: 26012
506Content-Type: image/gif
507
508... 26012 bytes of image data ...
509</artwork></figure>
510<t>
511   If multiple parts are being transferred, the server generating the 206
512   response &MUST; generate a "multipart/byteranges" payload, as defined
513   in <xref target="internet.media.type.multipart.byteranges"/>, and send a
514   <x:ref>Content-Type</x:ref> header field containing the
515   "multipart/byteranges" media type and its required boundary parameter.
516   For example:
517</t>
518<figure><preamble>
519</preamble><artwork type="message/http; msgtype=&#34;response&#34;" x:indent-with="  ">
520HTTP/1.1 206 Partial Content
521Date: Wed, 15 Nov 1995 06:25:24 GMT
522Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
523Content-Length: 1741
524Content-Type: multipart/byteranges; boundary=THIS_STRING_SEPARATES
525
526--THIS_STRING_SEPARATES
527Content-Type: application/pdf
528Content-Range: bytes 500-999/8000
529
530...the first range...
531--THIS_STRING_SEPARATES
532Content-Type: application/pdf
533Content-Range: bytes 7000-7999/8000
534
535...the second range
536--THIS_STRING_SEPARATES--
537</artwork></figure>
538<t>
539   A server &MAY; combine requested ranges when those ranges are overlapping
540   (see <xref target="overlapping.ranges"/>).
541</t>
542<t>
543   A response to a request for a single range &MUST-NOT; be sent using the
544   multipart/byteranges media type.  A response to a request for
545   multiple ranges, whose result is a single range, &MAY; be sent as a
546   multipart/byteranges media type with one part. A client that cannot
547   decode a multipart/byteranges message &MUST-NOT; ask for multiple
548   ranges in a single request.
549</t>
550<t>
551   When a client asks for multiple ranges in one request, the
552   server &SHOULD; send them in the order that they appeared in the
553   request.
554</t>
555<t>
556   When a 206 response is generated, the sender &MUST; generate the following
557   header fields:
558  <list style="symbols">
559    <t>
560        Either a <x:ref>Content-Range</x:ref> header field
561        (<xref target="header.content-range"/>) indicating the single range
562        included with this response, or a multipart/byteranges
563        <x:ref>Content-Type</x:ref> indicating that multiple ranges are
564        enclosed as multipart body-parts.
565    </t>
566    <t>
567        <x:ref>Date</x:ref>
568    </t>
569    <t>
570        <x:ref>Cache-Control</x:ref>, <x:ref>ETag</x:ref>,
571        <x:ref>Expires</x:ref>, <x:ref>Content-Location</x:ref> and/or
572        <x:ref>Vary</x:ref>, if the header field would have been sent in a
573        <x:ref>200 (OK)</x:ref> response to the same request
574    </t>
575  </list>
576</t>
577<t>
578   If a 206 is generated in response to a request with an <x:ref>If-Range</x:ref>
579   header field, the sender &SHOULD-NOT; generate other representation header
580   fields beyond those described above.
581   Otherwise, the sender &MUST; generate all of the same representation header
582   fields that would have been sent in a <x:ref>200 (OK)</x:ref> response
583   to the same request.
584</t>
585<t>
586   Caches &MAY; use a heuristic (see &p6-heuristic;) to determine
587   freshness for 206 responses.
588</t>
589</section>
590
591<section title="Content-Range" anchor="header.content-range">
592  <iref primary="true" item="Content-Range header field" x:for-anchor=""/>
593  <x:anchor-alias value="Content-Range"/>
594  <x:anchor-alias value="byte-content-range"/>
595  <x:anchor-alias value="byte-range-resp"/>
596  <x:anchor-alias value="byte-range"/>
597  <x:anchor-alias value="unsatisfied-range"/>
598  <x:anchor-alias value="complete-length"/>
599  <x:anchor-alias value="other-content-range"/>
600  <x:anchor-alias value="other-range-resp"/>
601<t>
602   The "Content-Range" header field is sent with a partial representation to
603   specify what range of the full representation is enclosed as payload.
604</t>
605<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Range"/><iref primary="true" item="Grammar" subitem="byte-content-range"/><iref primary="true" item="Grammar" subitem="byte-range-resp"/><iref primary="true" item="Grammar" subitem="byte-range"/><iref primary="true" item="Grammar" subitem="unsatisfied-range"/><iref primary="true" item="Grammar" subitem="other-content-range"/><iref primary="true" item="Grammar" subitem="other-range-resp"/><iref primary="true" item="Grammar" subitem="complete-length"/>
606  <x:ref>Content-Range</x:ref>       = <x:ref>byte-content-range</x:ref>
607                      / <x:ref>other-content-range</x:ref>
608                         
609  <x:ref>byte-content-range</x:ref>  = <x:ref>bytes-unit</x:ref> <x:ref>SP</x:ref>
610                        ( <x:ref>byte-range-resp</x:ref> / <x:ref>unsatisfied-range</x:ref> )
611
612  <x:ref>byte-range-resp</x:ref>     = <x:ref>byte-range</x:ref> "/" ( <x:ref>complete-length</x:ref> / "*" )
613  <x:ref>byte-range</x:ref>          = <x:ref>first-byte-pos</x:ref> "-" <x:ref>last-byte-pos</x:ref>
614  <x:ref>unsatisfied-range</x:ref>   = "*/" <x:ref>complete-length</x:ref>
615                         
616  <x:ref>complete-length</x:ref>     = 1*<x:ref>DIGIT</x:ref>
617 
618  <x:ref>other-content-range</x:ref> = <x:ref>other-range-unit</x:ref> <x:ref>SP</x:ref> <x:ref>other-range-resp</x:ref>
619  <x:ref>other-range-resp</x:ref>    = *<x:ref>CHAR</x:ref>
620</artwork></figure>
621<t>  
622   Range units are defined in <xref target="range.units"/>. A recipient of a
623   <x:ref>206 (Partial Content)</x:ref> response containing a
624   <x:ref>Content-Range</x:ref> header field with a <x:ref>range unit</x:ref>
625   that the recipient does not understand &MUST-NOT; attempt to recombine it
626   with a stored representation. A proxy that receives such a message
627   &SHOULD; forward it downstream.
628</t>
629<t>
630   For byte ranges, a sender &SHOULD; indicate the complete length of the
631   representation from which the range has been extracted unless the complete
632   length is unknown or difficult to determine. An asterisk character ("*") in
633   place of the complete-length indicates that the representation length was
634   unknown when the header field was generated.
635</t>
636<t>
637   A Content-Range field value with a <x:ref>byte-range-resp</x:ref> that has
638   a <x:ref>last-byte-pos</x:ref> value less than its
639   <x:ref>first-byte-pos</x:ref> value, or a <x:ref>complete-length</x:ref>
640   value less than or equal to its <x:ref>last-byte-pos</x:ref> value, is
641   invalid. The recipient of an invalid <x:ref>Content-Range</x:ref> &MUST-NOT;
642   attempt to recombine the received content with a stored representation.
643</t>
644<t>
645   A server generating a <x:ref>206 (Partial Content)</x:ref> response to a
646   byte range request &MUST; send, in each body-part of a multipart response
647   or in the header block of a single part response, a Content-Range header
648   field containing a <x:ref>byte-range-resp</x:ref> value that reflects the
649   corresponding range being sent. The following example would apply
650   when the complete length of the selected representation is known by the
651   sender to be 1234 bytes:
652</t>
653<figure><artwork type="example">
654  Content-Range: bytes 42-1233/1234
655</artwork></figure>
656<t>
657   or this second example would apply when the complete length is unknown:
658</t>
659<figure><artwork type="example">
660  Content-Range: bytes 42-1233/*
661</artwork></figure>
662<t>
663   A server generating a <x:ref>416 (Range Not Satisfiable)</x:ref> response
664   to a byte range request &SHOULD; send a Content-Range header field with an
665   <x:ref>unsatisfied-range</x:ref> value, as in the following example:
666</t>
667<figure><artwork type="example">
668  Content-Range: bytes */1234
669</artwork></figure>
670<t>
671   The complete-length in a 416 response indicates the current length of the
672   selected representation, which will be known by the server generating the
673   response because that is how it determined the range to be unsatisfiable.
674</t>
675<t>
676   The "Content-Range" header field has no meaning for status codes that do
677   not explicitly describe its semantic. For this specification, only the
678   <x:ref>206 (Partial Content)</x:ref> and
679   <x:ref>416 (Range Not Satisfiable)</x:ref> status codes describe a meaning
680   for Content-Range.
681</t>
682<t>
683   More examples of Content-Range values, assuming that the representation
684   contains a total of 1234 bytes:
685   <list style="symbols">
686      <t>
687        The first 500 bytes:
688<figure><artwork type="example" x:indent-with="   ">
689  Content-Range: bytes 0-499/1234
690</artwork></figure>
691      </t>   
692      <t>
693        The second 500 bytes:
694<figure><artwork type="example" x:indent-with="   ">
695  Content-Range: bytes 500-999/1234
696</artwork></figure>
697      </t>   
698      <t>
699        All except for the first 500 bytes:
700<figure><artwork type="example" x:indent-with="   ">
701  Content-Range: bytes 500-1233/1234
702</artwork></figure>
703      </t>   
704      <t>
705        The last 500 bytes:
706<figure><artwork type="example" x:indent-with="   ">
707  Content-Range: bytes 734-1233/1234
708</artwork></figure>
709      </t>   
710   </list>
711</t>
712</section>
713
714<section title="Combining Ranges" anchor="combining.byte.ranges">
715<t>
716   A response might transfer only a subrange of a representation if the
717   connection closed prematurely or if the request used one or more Range
718   specifications.  After several such transfers, a client might have
719   received several ranges of the same representation.  These ranges can only
720   be safely combined if they all have in common the same strong validator,
721   where "strong validator" is defined to be either an entity-tag that is
722   not marked as weak (&entity-tags;) or, if no entity-tag is provided, a
723   <x:ref>Last-Modified</x:ref> value that is strong in the sense defined by
724   &lastmod-comparison;.
725</t>
726<t>
727   When a client receives an incomplete <x:ref>200 (OK)</x:ref> response or a
728   <x:ref>206 (Partial Content)</x:ref> response, and already has one or more
729   partial responses for the same method and effective request URI that have
730   the same strong validator as present in the new response,
731   the recipient &MAY; combine some or all of those responses into a set of
732   continuous ranges. A client &MUST-NOT; combine responses that differ in the
733   strong validator or that do not have a strong validator.
734</t>
735<t>
736   If the new response is an incomplete <x:ref>200 (OK)</x:ref> response, then
737   the header fields of that new response are used for any combined response
738   and replace those of the matching stored responses.
739</t>
740<t>
741   If the new response is a <x:ref>206 (Partial Content)</x:ref> response and
742   at least one of the matching stored responses is a <x:ref>200 (OK)</x:ref>,
743   then the combined response header fields consist of the most recent 200
744   response's header fields. If all of the matching stored responses are 206
745   responses, then the stored response with the most recent header fields is
746   used as the source of header fields for the combined response, except that
747   the client &MUST; use other header fields provided in the new response,
748   aside from <x:ref>Content-Range</x:ref>, to replace all instances of the
749   corresponding header fields in the stored response.
750</t>
751<t>
752   The combined response message body consists of the union of partial
753   content ranges in the new response and each of the selected responses.
754   If the union consists of the entire range of the representation, then the
755   client &MUST; record the combined response as if it were a complete
756   <x:ref>200 (OK)</x:ref> response, including a <x:ref>Content-Length</x:ref>
757   header field that reflects the complete length.
758   Otherwise, the client &MUST; record the set of continuous ranges as one of
759   the following:
760   an incomplete <x:ref>200 (OK)</x:ref> response if the combined response is
761   a prefix of the representation,
762   a single <x:ref>206 (Partial Content)</x:ref> response containing a
763   multipart/byteranges body, or
764   multiple <x:ref>206 (Partial Content)</x:ref> responses, each with one
765   continuous range that is indicated by a <x:ref>Content-Range</x:ref> header
766   field.
767</t>
768</section>
769
770<section title="416 Range Not Satisfiable" anchor="status.416">
771  <iref primary="true" item="416 Range Not Satisfiable (status code)" x:for-anchor=""/>
772  <x:anchor-alias value="416 (Range Not Satisfiable)"/>
773<t>
774   The <x:dfn>416 (Range Not Satisfiable)</x:dfn> status code
775   indicates that none of the ranges-specifier values in the request's
776   <x:ref>Range</x:ref> header field (<xref target="header.range"/>)
777   overlap the current
778   extent of the selected resource and the request did not include an
779   <x:ref>If-Range</x:ref> header field (<xref target="header.if-range"/>).
780   (For byte-ranges, this means that the first-byte-pos of all of the
781   byte-range-spec values were greater than the current length of the selected
782   representation.)
783</t>
784<t>
785   When this status code is sent in response to a byte-range request, the
786   sender &SHOULD; generate a <x:ref>Content-Range</x:ref> header field
787   specifying the current length of the selected representation
788   (see <xref target="header.content-range"/>).
789</t>
790<figure>
791<preamble>For example:</preamble>
792<artwork type="message/http; msgtype=&#34;response&#34;" x:indent-with="  ">
793HTTP/1.1 416 Range Not Satisfiable
794Date: Mon, 20 Jan 2012 15:41:54 GMT
795Content-Range: bytes */47022
796Content-Type: image/gif
797</artwork></figure>
798<x:note>
799  <t>
800    &Note; Clients cannot depend on servers to send a <x:ref>416 (Range Not
801    Satisfiable)</x:ref> response instead of a <x:ref>200 (OK)</x:ref>
802    response for an unsatisfiable <x:ref>Range</x:ref> header field, since not
803    all servers implement this header field.
804  </t>
805</x:note>
806</section>
807</section>
808
809<section title="IANA Considerations" anchor="IANA.considerations">
810
811<section title="Range Unit Registry" anchor="range.unit.registry">
812<t>
813   The HTTP Range Unit Registry defines the name space for the range
814   unit names and refers to their corresponding specifications.
815   The registry is maintained at
816   <eref target="http://www.iana.org/assignments/http-parameters"/>.
817</t>
818
819<section title="Procedure" anchor="range.unit.registry.procedure">
820<t>
821   Registration of an HTTP Range Unit &MUST; include the following fields:
822   <list style="symbols">
823     <t>Name</t>
824     <t>Description</t>
825     <t>Pointer to specification text</t>
826   </list>
827</t>
828<t>
829  Values to be added to this name space require IETF Review
830  (see <xref target="RFC5226" x:fmt="," x:sec="4.1"/>).
831</t>
832</section>
833
834<section title="Registrations" anchor="range.unit.registration">
835<t>
836   The initial HTTP Range Unit Registry shall contain the registrations
837   below:
838</t>
839<texttable align="left" suppress-title="true" anchor="iana.range.units.table">
840   <ttcol>Range Unit Name</ttcol>
841   <ttcol>Description</ttcol>
842   <ttcol>Reference</ttcol>
843
844   <c>bytes</c>
845   <c>a range of octets</c>
846   <c><xref target="byte.ranges"/></c>
847
848   <c>none</c>
849   <c>reserved as keyword, indicating no ranges are supported</c>
850   <c><xref target="header.accept-ranges"/></c>
851</texttable>
852<t>
853   The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".
854</t>
855</section>
856</section>
857
858<section title="Status Code Registration" anchor="status.code.registration">
859<t>
860   The HTTP Status Code Registry located at <eref target="http://www.iana.org/assignments/http-status-codes"/>
861   shall be updated with the registrations below:
862</t>
863<?BEGININC p5-range.iana-status-codes ?>
864<!--AUTOGENERATED FROM extract-status-code-defs.xslt, do not edit manually-->
865<texttable align="left" suppress-title="true" anchor="iana.status.code.registration.table">
866   <ttcol>Value</ttcol>
867   <ttcol>Description</ttcol>
868   <ttcol>Reference</ttcol>
869   <c>206</c>
870   <c>Partial Content</c>
871   <c>
872      <xref target="status.206"/>
873   </c>
874   <c>416</c>
875   <c>Range Not Satisfiable</c>
876   <c>
877      <xref target="status.416"/>
878   </c>
879</texttable>
880<!--(END)-->
881<?ENDINC p5-range.iana-status-codes ?>
882</section>
883
884<section title="Header Field Registration" anchor="header.field.registration">
885<t>
886   The Message Header Field Registry located at <eref target="http://www.iana.org/assignments/message-headers/message-header-index.html"/> shall be updated
887   with the permanent registrations below (see <xref target="BCP90"/>):
888</t>
889<?BEGININC p5-range.iana-headers ?>
890<!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually-->
891<texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
892   <ttcol>Header Field Name</ttcol>
893   <ttcol>Protocol</ttcol>
894   <ttcol>Status</ttcol>
895   <ttcol>Reference</ttcol>
896
897   <c>Accept-Ranges</c>
898   <c>http</c>
899   <c>standard</c>
900   <c>
901      <xref target="header.accept-ranges"/>
902   </c>
903   <c>Content-Range</c>
904   <c>http</c>
905   <c>standard</c>
906   <c>
907      <xref target="header.content-range"/>
908   </c>
909   <c>If-Range</c>
910   <c>http</c>
911   <c>standard</c>
912   <c>
913      <xref target="header.if-range"/>
914   </c>
915   <c>Range</c>
916   <c>http</c>
917   <c>standard</c>
918   <c>
919      <xref target="header.range"/>
920   </c>
921</texttable>
922<!--(END)-->
923<?ENDINC p5-range.iana-headers ?>
924<t>
925   The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".
926</t>
927</section>
928
929</section>
930
931<section title="Security Considerations" anchor="security.considerations">
932<t>
933   This section is meant to inform developers, information providers, and
934   users of known security concerns specific to the HTTP/1.1 range
935   request mechanisms. More general security considerations are addressed
936   in HTTP messaging &messaging; and semantics &semantics;.
937</t>
938
939<section title="Overlapping Ranges" anchor="overlapping.ranges">
940<t>
941   Range requests containing overlapping ranges can lead to a situation
942   where the server is sending far more data than the size of the complete
943   resource representation.
944</t>
945</section>
946</section>
947
948<section title="Acknowledgments" anchor="acks">
949<t>
950  See &acks;.
951</t>
952</section>
953</middle>
954<back>
955
956<references title="Normative References">
957
958<reference anchor="Part1">
959  <front>
960    <title>Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</title>
961    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
962      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
963      <address><email>fielding@gbiv.com</email></address>
964    </author>
965    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
966      <organization abbrev="greenbytes">greenbytes GmbH</organization>
967      <address><email>julian.reschke@greenbytes.de</email></address>
968    </author>
969    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
970  </front>
971  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"/>
972  <x:source href="p1-messaging.xml" basename="p1-messaging">
973    <x:defines>Content-Length</x:defines>
974  </x:source>
975</reference>
976
977<reference anchor="Part2">
978  <front>
979    <title>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</title>
980    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
981      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
982      <address><email>fielding@gbiv.com</email></address>
983    </author>
984    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
985      <organization abbrev="greenbytes">greenbytes GmbH</organization>
986      <address><email>julian.reschke@greenbytes.de</email></address>
987    </author>
988    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
989  </front>
990  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p2-semantics-&ID-VERSION;"/>
991  <x:source href="p2-semantics.xml" basename="p2-semantics">
992    <x:defines>200 (OK)</x:defines>
993    <x:defines>410 (Gone)</x:defines>
994    <x:defines>Content-Location</x:defines>
995    <x:defines>Content-Type</x:defines>
996    <x:defines>Date</x:defines>
997    <x:defines>Location</x:defines>
998    <x:defines>Vary</x:defines>
999  </x:source>
1000</reference>
1001
1002<reference anchor="Part4">
1003  <front>
1004    <title>Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests</title>
1005    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1006      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
1007      <address><email>fielding@gbiv.com</email></address>
1008    </author>
1009    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1010      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1011      <address><email>julian.reschke@greenbytes.de</email></address>
1012    </author>
1013    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1014  </front>
1015  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p4-conditional-&ID-VERSION;"/>
1016  <x:source href="p4-conditional.xml" basename="p4-conditional">
1017    <x:defines>304 (Not Modified)</x:defines>
1018    <x:defines>ETag</x:defines>
1019    <x:defines>If-Match</x:defines>
1020    <x:defines>If-Modified-Since</x:defines>
1021    <x:defines>If-None-Match</x:defines>
1022    <x:defines>If-Unmodified-Since</x:defines>
1023    <x:defines>Last-Modified</x:defines>
1024  </x:source>
1025</reference>
1026
1027<reference anchor="Part6">
1028  <front>
1029    <title>Hypertext Transfer Protocol (HTTP/1.1): Caching</title>
1030    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1031      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
1032      <address><email>fielding@gbiv.com</email></address>
1033    </author>
1034    <author initials="M." surname="Nottingham" fullname="Mark Nottingham" role="editor">
1035      <organization>Akamai</organization>
1036      <address><email>mnot@mnot.net</email></address>
1037    </author>
1038    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1039      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1040      <address><email>julian.reschke@greenbytes.de</email></address>
1041    </author>
1042    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1043  </front>
1044  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-&ID-VERSION;"/>
1045  <x:source href="p6-cache.xml" basename="p6-cache">
1046    <x:defines>Cache-Control</x:defines>
1047    <x:defines>Expires</x:defines>
1048  </x:source>
1049</reference>
1050
1051<reference anchor="RFC2046">
1052  <front>
1053    <title abbrev="Media Types">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</title>
1054    <author initials="N." surname="Freed" fullname="Ned Freed">
1055      <organization>Innosoft International, Inc.</organization>
1056      <address><email>ned@innosoft.com</email></address>
1057    </author>
1058    <author initials="N." surname="Borenstein" fullname="Nathaniel S. Borenstein">
1059      <organization>First Virtual Holdings</organization>
1060      <address><email>nsb@nsb.fv.com</email></address>
1061    </author>
1062    <date month="November" year="1996"/>
1063  </front>
1064  <seriesInfo name="RFC" value="2046"/>
1065</reference>
1066
1067<reference anchor="RFC2119">
1068  <front>
1069    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
1070    <author initials="S." surname="Bradner" fullname="Scott Bradner">
1071      <organization>Harvard University</organization>
1072      <address><email>sob@harvard.edu</email></address>
1073    </author>
1074    <date month="March" year="1997"/>
1075  </front>
1076  <seriesInfo name="BCP" value="14"/>
1077  <seriesInfo name="RFC" value="2119"/>
1078</reference>
1079
1080<reference anchor="RFC5234">
1081  <front>
1082    <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title>
1083    <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor">
1084      <organization>Brandenburg InternetWorking</organization>
1085      <address>
1086        <email>dcrocker@bbiw.net</email>
1087      </address> 
1088    </author>
1089    <author initials="P." surname="Overell" fullname="Paul Overell">
1090      <organization>THUS plc.</organization>
1091      <address>
1092        <email>paul.overell@thus.net</email>
1093      </address>
1094    </author>
1095    <date month="January" year="2008"/>
1096  </front>
1097  <seriesInfo name="STD" value="68"/>
1098  <seriesInfo name="RFC" value="5234"/>
1099</reference>
1100
1101</references>
1102
1103<references title="Informative References">
1104
1105<reference anchor="RFC2616">
1106  <front>
1107    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
1108    <author initials="R." surname="Fielding" fullname="R. Fielding">
1109      <organization>University of California, Irvine</organization>
1110      <address><email>fielding@ics.uci.edu</email></address>
1111    </author>
1112    <author initials="J." surname="Gettys" fullname="J. Gettys">
1113      <organization>W3C</organization>
1114      <address><email>jg@w3.org</email></address>
1115    </author>
1116    <author initials="J." surname="Mogul" fullname="J. Mogul">
1117      <organization>Compaq Computer Corporation</organization>
1118      <address><email>mogul@wrl.dec.com</email></address>
1119    </author>
1120    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
1121      <organization>MIT Laboratory for Computer Science</organization>
1122      <address><email>frystyk@w3.org</email></address>
1123    </author>
1124    <author initials="L." surname="Masinter" fullname="L. Masinter">
1125      <organization>Xerox Corporation</organization>
1126      <address><email>masinter@parc.xerox.com</email></address>
1127    </author>
1128    <author initials="P." surname="Leach" fullname="P. Leach">
1129      <organization>Microsoft Corporation</organization>
1130      <address><email>paulle@microsoft.com</email></address>
1131    </author>
1132    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
1133      <organization>W3C</organization>
1134      <address><email>timbl@w3.org</email></address>
1135    </author>
1136    <date month="June" year="1999"/>
1137  </front>
1138  <seriesInfo name="RFC" value="2616"/>
1139</reference>
1140
1141<reference anchor='BCP90'>
1142  <front>
1143    <title>Registration Procedures for Message Header Fields</title>
1144    <author initials='G.' surname='Klyne' fullname='G. Klyne'>
1145      <organization>Nine by Nine</organization>
1146      <address><email>GK-IETF@ninebynine.org</email></address>
1147    </author>
1148    <author initials='M.' surname='Nottingham' fullname='M. Nottingham'>
1149      <organization>BEA Systems</organization>
1150      <address><email>mnot@pobox.com</email></address>
1151    </author>
1152    <author initials='J.' surname='Mogul' fullname='J. Mogul'>
1153      <organization>HP Labs</organization>
1154      <address><email>JeffMogul@acm.org</email></address>
1155    </author>
1156    <date year='2004' month='September' />
1157  </front>
1158  <seriesInfo name='BCP' value='90' />
1159  <seriesInfo name='RFC' value='3864' />
1160</reference>
1161
1162<reference anchor="BCP13">
1163  <front>
1164    <title>Media Type Specifications and Registration Procedures</title>
1165    <author initials="N." surname="Freed" fullname="N. Freed">
1166      <organization>Sun Microsystems</organization>
1167      <address>
1168        <email>ned.freed@mrochek.com</email>
1169      </address>
1170    </author>
1171    <author initials="J." surname="Klensin" fullname="J. Klensin">
1172      <address>
1173        <email>klensin+ietf@jck.com</email>
1174      </address>
1175    </author>
1176    <date year="2005" month="December"/>
1177  </front>
1178  <seriesInfo name="BCP" value="13"/>
1179  <seriesInfo name="RFC" value="4288"/>
1180</reference>
1181
1182<reference anchor='RFC5226'>
1183  <front>
1184    <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
1185    <author initials='T.' surname='Narten' fullname='T. Narten'>
1186      <organization>IBM</organization>
1187      <address><email>narten@us.ibm.com</email></address>
1188    </author>
1189    <author initials='H.' surname='Alvestrand' fullname='H. Alvestrand'>
1190      <organization>Google</organization>
1191      <address><email>Harald@Alvestrand.no</email></address>
1192    </author>
1193    <date year='2008' month='May' />
1194  </front>
1195  <seriesInfo name='BCP' value='26' />
1196  <seriesInfo name='RFC' value='5226' />
1197</reference>
1198
1199</references>
1200
1201<section title="Internet Media Type multipart/byteranges" anchor="internet.media.type.multipart.byteranges">
1202<iref item="Media Type" subitem="multipart/byteranges" primary="true"/>
1203<iref item="multipart/byteranges Media Type" primary="true"/>
1204<t>
1205   When a <x:ref>206 (Partial Content)</x:ref> response message includes the
1206   content of multiple ranges, they are transmitted as body-parts in a
1207   multipart message body (<xref target="RFC2046" x:fmt="," x:sec="5.1"/>)
1208   with the media type of "multipart/byteranges".  The following definition is
1209   to be registered with IANA <xref target="BCP13"/>.
1210</t>
1211<t>
1212   The multipart/byteranges media type includes one or more body-parts, each
1213   with its own <x:ref>Content-Type</x:ref> and <x:ref>Content-Range</x:ref>
1214   fields. The required boundary parameter specifies the boundary string used
1215   to separate each body-part.
1216</t>
1217<t>
1218  <list style="hanging" x:indent="12em">
1219    <t hangText="Type name:">
1220      multipart
1221    </t>
1222    <t hangText="Subtype name:">
1223      byteranges
1224    </t>
1225    <t hangText="Required parameters:">
1226      boundary
1227    </t>
1228    <t hangText="Optional parameters:">
1229      none
1230    </t>
1231    <t hangText="Encoding considerations:">
1232      only "7bit", "8bit", or "binary" are permitted
1233    </t>
1234    <t hangText="Security considerations:">
1235      none
1236    </t>
1237    <t hangText="Interoperability considerations:">
1238      none
1239    </t>
1240    <t hangText="Published specification:">
1241      This specification (see <xref target="internet.media.type.multipart.byteranges"/>).
1242    </t>
1243    <t hangText="Applications that use this media type:">
1244      HTTP components supporting multiple ranges in a single request.
1245    </t>
1246    <t hangText="Additional information:">
1247      <list style="hanging">
1248        <t hangText="Magic number(s):">none</t>
1249        <t hangText="File extension(s):">none</t>
1250        <t hangText="Macintosh file type code(s):">none</t>
1251      </list>
1252    </t>
1253    <t hangText="Person and email address to contact for further information:">
1254      See Authors Section.
1255    </t>
1256    <t hangText="Intended usage:">
1257      COMMON
1258    </t>
1259    <t hangText="Restrictions on usage:">
1260      none
1261    </t>
1262    <t hangText="Author/Change controller:">
1263      IESG
1264    </t>
1265  </list>
1266</t>
1267<t>
1268  Implementation Notes:
1269  <list style="numbers">
1270      <t>Additional CRLFs might precede the first boundary string in the body.</t>
1271
1272      <t>Although <xref target="RFC2046"/> permits the boundary string to be
1273         quoted, some existing implementations handle a quoted boundary
1274         string incorrectly.</t>
1275
1276      <t>A number of clients and servers were coded to an early draft
1277         of the byteranges specification that used a media type of
1278         multipart/x-byteranges<iref item="multipart/x-byteranges Media Type"/><iref item="Media Type" subitem="multipart/x-byteranges"/>,
1279         which is almost (but not quite) compatible with this type.</t>
1280  </list>
1281</t>
1282<t>
1283   Despite the name, the "multipart/byteranges" media type is not limited to
1284   byte ranges. The following example uses an "exampleunit" range unit:
1285</t>
1286<figure><artwork type="message/http; msgtype=&#34;response&#34;" x:indent-with="  ">
1287HTTP/1.1 206 Partial Content
1288Date: Tue, 14 Nov 1995 06:25:24 GMT
1289Last-Modified: Tue, 14 July 04:58:08 GMT
1290Content-Length: 2331785
1291Content-Type: multipart/byteranges; boundary=THIS_STRING_SEPARATES
1292
1293--THIS_STRING_SEPARATES
1294Content-Type: video/example
1295Content-Range: exampleunit 1.2-4.3/25
1296
1297...the first range...
1298--THIS_STRING_SEPARATES
1299Content-Type: video/example
1300Content-Range: exampleunit 11.2-14.3/25
1301
1302...the second range
1303--THIS_STRING_SEPARATES--
1304</artwork>
1305</figure>
1306</section>
1307
1308<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
1309
1310<t>
1311  A weak validator cannot be used in a <x:ref>206</x:ref> response.
1312  (<xref target="status.206"/>)
1313</t>
1314<t>
1315  The Content-Range header field only has meaning when the status code
1316  explicitly defines its use.
1317  (<xref target="header.content-range" />)
1318</t>
1319<t>
1320  Servers are given more leeway in how they respond to a range request,
1321  in order to mitigate abuse by malicious (or just greedy) clients.
1322</t>
1323<t>
1324  multipart/byteranges can consist of a single part.
1325  (<xref target="internet.media.type.multipart.byteranges"/>)
1326</t>
1327<t>
1328  This specification introduces a Range Unit Registry.
1329  (<xref target="range.unit.registry"/>)
1330</t>
1331</section>
1332
1333<section title="Imported ABNF" anchor="imported.abnf">
1334  <x:anchor-alias value="ALPHA"/>
1335  <x:anchor-alias value="CHAR"/>
1336  <x:anchor-alias value="CR"/>
1337  <x:anchor-alias value="DIGIT"/>
1338  <x:anchor-alias value="LF"/>
1339  <x:anchor-alias value="OCTET"/>
1340  <x:anchor-alias value="SP"/>
1341  <x:anchor-alias value="VCHAR"/>
1342  <x:anchor-alias value="token"/>
1343  <x:anchor-alias value="OWS"/>
1344  <x:anchor-alias value="HTTP-date"/>
1345  <x:anchor-alias value="entity-tag"/>
1346<t>
1347  The following core rules are included by
1348  reference, as defined in <xref target="RFC5234" x:fmt="of" x:sec="B.1"/>:
1349  ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls),
1350  DIGIT (decimal 0-9), DQUOTE (double quote),
1351  HEXDIG (hexadecimal 0-9/A-F/a-f), LF (line feed),
1352  OCTET (any 8-bit sequence of data), SP (space), and
1353  VCHAR (any visible US-ASCII character).
1354</t>
1355<t>
1356  Note that all rules derived from <x:ref>token</x:ref> are to
1357  be compared case-insensitively, like <x:ref>range-unit</x:ref> and
1358  <x:ref>acceptable-ranges</x:ref>.
1359</t>
1360<t>
1361  The rules below are defined in <xref target="Part1"/>:
1362</t>
1363<figure><artwork type="abnf2616">
1364  <x:ref>OWS</x:ref>        = &lt;OWS, defined in &whitespace;&gt;
1365  <x:ref>token</x:ref>      = &lt;token, defined in &field-components;&gt;
1366</artwork></figure>
1367<t>
1368  The rules below are defined in other parts:
1369</t>
1370<figure><artwork type="abnf2616">
1371  <x:ref>HTTP-date</x:ref>  = &lt;HTTP-date, defined in &http-date;&gt;
1372  <x:ref>entity-tag</x:ref> = &lt;entity-tag, defined in &entity-tags;&gt;
1373</artwork></figure>
1374</section>
1375
1376<?BEGININC p5-range.abnf-appendix ?>
1377<section xmlns:x="http://purl.org/net/xml2rfc/ext" title="Collected ABNF" anchor="collected.abnf">
1378<figure>
1379<artwork type="abnf" name="p5-range.parsed-abnf">
1380<x:ref>Accept-Ranges</x:ref> = acceptable-ranges
1381
1382<x:ref>Content-Range</x:ref> = byte-content-range / other-content-range
1383
1384<x:ref>HTTP-date</x:ref> = &lt;HTTP-date, defined in [Part2], Section 7.1.1.1&gt;
1385
1386<x:ref>If-Range</x:ref> = entity-tag / HTTP-date
1387
1388<x:ref>OWS</x:ref> = &lt;OWS, defined in [Part1], Section 3.2.3&gt;
1389
1390<x:ref>Range</x:ref> = byte-ranges-specifier / other-ranges-specifier
1391
1392<x:ref>acceptable-ranges</x:ref> = ( *( "," OWS ) range-unit *( OWS "," [ OWS
1393 range-unit ] ) ) / "none"
1394
1395<x:ref>byte-content-range</x:ref> = bytes-unit SP ( byte-range-resp /
1396 unsatisfied-range )
1397<x:ref>byte-range</x:ref> = first-byte-pos "-" last-byte-pos
1398<x:ref>byte-range-resp</x:ref> = byte-range "/" ( complete-length / "*" )
1399<x:ref>byte-range-set</x:ref> = *( "," OWS ) ( byte-range-spec /
1400 suffix-byte-range-spec ) *( OWS "," [ OWS ( byte-range-spec /
1401 suffix-byte-range-spec ) ] )
1402<x:ref>byte-range-spec</x:ref> = first-byte-pos "-" [ last-byte-pos ]
1403<x:ref>byte-ranges-specifier</x:ref> = bytes-unit "=" byte-range-set
1404<x:ref>bytes-unit</x:ref> = "bytes"
1405
1406<x:ref>complete-length</x:ref> = 1*DIGIT
1407
1408<x:ref>entity-tag</x:ref> = &lt;entity-tag, defined in [Part4], Section 2.3&gt;
1409
1410<x:ref>first-byte-pos</x:ref> = 1*DIGIT
1411
1412<x:ref>last-byte-pos</x:ref> = 1*DIGIT
1413
1414<x:ref>other-content-range</x:ref> = other-range-unit SP other-range-resp
1415<x:ref>other-range-resp</x:ref> = *CHAR
1416<x:ref>other-range-set</x:ref> = 1*CHAR
1417<x:ref>other-range-unit</x:ref> = token
1418<x:ref>other-ranges-specifier</x:ref> = other-range-unit "=" other-range-set
1419
1420<x:ref>range-unit</x:ref> = bytes-unit / other-range-unit
1421
1422<x:ref>suffix-byte-range-spec</x:ref> = "-" suffix-length
1423<x:ref>suffix-length</x:ref> = 1*DIGIT
1424
1425<x:ref>token</x:ref> = &lt;token, defined in [Part1], Section 3.2.6&gt;
1426
1427<x:ref>unsatisfied-range</x:ref> = "*/" complete-length
1428</artwork>
1429</figure>
1430</section>
1431<?ENDINC p5-range.abnf-appendix ?>
1432
1433
1434<section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log">
1435<t>
1436  Changes up to the first Working Group Last Call draft are summarized
1437  in <eref target="http://tools.ietf.org/html/draft-ietf-httpbis-p5-range-19#appendix-D"/>.
1438</t>
1439
1440<section title="Since draft-ietf-httpbis-p5-range-19" anchor="changes.since.19">
1441<t>
1442  Closed issues:
1443  <list style="symbols">
1444    <t>
1445      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/358"/>:
1446      "ABNF list expansion code problem"
1447    </t>
1448    <t>
1449      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/361"/>:
1450      "ABNF requirements for recipients"
1451    </t>
1452    <t>
1453      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/367"/>:
1454      "reserve 'none' as byte range unit"
1455    </t>
1456    <t>
1457      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/368"/>:
1458      "note introduction of new IANA registries as normative changes"
1459    </t>
1460    <t>
1461      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/369"/>:
1462      "range units vs leading zeroes vs size"
1463    </t>
1464  </list>
1465</t>
1466</section>
1467
1468<section title="Since draft-ietf-httpbis-p5-range-20" anchor="changes.since.20">
1469<t>
1470  <list style="symbols">
1471    <t>
1472      Conformance criteria and considerations regarding error handling are
1473      now defined in Part 1.
1474    </t>
1475  </list>
1476</t>
1477</section>
1478
1479<section title="Since draft-ietf-httpbis-p5-range-21" anchor="changes.since.21">
1480<t>
1481  None yet.
1482</t>
1483</section>
1484
1485</section>
1486
1487</back>
1488</rfc>
Note: See TracBrowser for help on using the repository browser.