title: HTTP Status Code 206: When should it be used?
body: <p>The <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.7" rel="nofollow noreferrer">206 status code</a> (w3.org) indicates a partial result in response to a request with a <code>Range</code> header.</p>
  
  <p>So "clearly" if the requested document is e.g. 1024 bytes long, and the <code>Range</code> header is <code>bytes=0-512</code> then a status code of <code>206 Partial Content</code> should be returned. (Assuming that the server is able to return the content)</p>
  
  <p>BUT what if the <code>Range</code> is <code>bytes=0-2000</code>?<br>
  Should <code>200 OK</code> or <code>206 Partial Content</code> be returned?<br>
  It seems to me that this isn't clearly defined in the specification -- or maybe I'm not reading the right place?</p>
  
  <p><strong>Why do I care?</strong>
  I ask because the <a href="https://www.varnish-cache.org/" rel="nofollow noreferrer">Varnish Cache</a> seems to always return <code>206 Partial Content</code>, whereas the <a href="https://developers.facebook.com/tools/debug/" rel="nofollow noreferrer">Facebook Open Graph debugger</a> seems to expect <code>200 OK</code>. [<a href="https://stackoverflow.com/questions/9807771/facebook-debugger-response-206">1</a>] [<a href="https://stackoverflow.com/questions/8492528/facebook-debugger-lint-tool-gets-http-206-doesnt-detect-open-graph-meta-tags">2</a>]</p>
  
  <p><em>Example</em>: GET request to Varnish<br>
  (I receive the full document, and yet <code>206 Partial Content</code> is returned)</p>
  
  <pre><code>&gt; curl --dump-header - -H 'Range: bytes=0-7000' https://www.varnish-cache.org/sites/all/themes/varnish_d7/logo.png
  HTTP/1.1 206 Partial Content
  Server: nginx/1.1.19
  Date: Mon, 14 Apr 2014 22:43:31 GMT
  Content-Type: image/png
  Content-Length: 2884
  Connection: keep-alive
  Last-Modified: Thu, 15 Dec 2011 12:30:46 GMT
  Accept-Ranges: bytes
  X-Varnish: 1979866667
  Age: 0
  Via: 1.1 varnish
  Content-Range: bytes 0-2883/2884
  </code></pre>
  
  <p>Further w3 reference: <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35" rel="nofollow noreferrer">http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35</a></p>