varnish serves truncated files

bai.xiaoyu at gmail.com bai.xiaoyu at gmail.com
Thu Jul 1 10:06:01 CEST 2010


I have some files served through varnish.  Users can only get part of
the file.  For example, a mp3 is 26mb, but the browser can only get
the 600+kb (by streaming or direct downloading), except chrome, which
get the file of correct size.

When user get the file directly from apache, all browsers can get the
file of correct size.

In the http header, I see varnish reponse with the correct
content-length, but i don't why the browsers only get part of the
file.

http://example.com/disney/mp3/FindingNemo.mp3

GET /disney/mp3/FindingNemo.mp3 HTTP/1.1
Host: cdn1.2u4u.com.cn
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3)
Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive

HTTP/1.1 200 OK
Server: Apache
Cache-Control: public, no-transform
Expires: Thu, 15 Apr 2012 20:00:00 GMT
Content-Type: audio/mpeg
Content-Length: 26886896
Date: Thu, 01 Jul 2010 07:16:13 GMT
X-Varnish: 1641609202
Age: 0
Via: 1.1 varnish
Connection: keep-alive

## This is my varnish config file in whole

backend default {
.host = "127.0.0.1";
.port = "8080";
.connect_timeout = 600s;
.first_byte_timeout = 600s;
.between_bytes_timeout = 600s;
}

sub vcl_recv {
 if (req.url ~ "\.(png|gif|jpg|swf|css|js)$") {
    lookup;
 }
}

sub vcl_fetch {
 if (req.url ~ "\.(png|gif|jpg|swf|css|js)$") {
  remove obj.http.Set-Cookie;
 }
}




More information about the varnish-misc mailing list