[Varnish] #1618: The "Range" header is not honored for a cache miss.

Varnish varnish-bugs at varnish-cache.org
Sat Oct 25 00:48:58 CEST 2014

#1618: The "Range" header is not honored for a cache miss.
 Reporter:  jeffawang          |       Type:  defect
   Status:  new                |   Priority:  high
Milestone:                     |  Component:  build
  Version:  4.0.2              |   Severity:  normal
 Keywords:  range header miss  |
 Context: I'm sending a request to the varnish cache (v4.0.2), which sits
 on top of a tomcat server that does not support the Range http header.

 When I submit a request with "Range: bytes=0-0" to Varnish for a not-yet-
 cached object, I get a non-ranged response (more than one byte) and a HTTP
 code 200.

 When I submit precisely the same request again with the same headers, I
 get the ranged response (only the first byte) and a HTTP code 206.
 Subsequent requests return ranged 206s, until it's purged from cache.

 The expected behavior should be a ranged 206 in each case (cache miss or
 cache hit), rather than different responses for the same request.

 Specifying the following in VCL makes the cache miss return a ranged 206,
 as expected:

 sub vcl_backend_response {
     # Workaround for ranged cache-miss 200
     set beresp.do_stream = false;

Ticket URL: <https://www.varnish-cache.org/trac/ticket/1618>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

More information about the varnish-bugs mailing list