HTTP Range support on 3.0.2
Rob S
rtshilston at gmail.com
Sun Mar 4 23:35:54 CET 2012
Hi,
I'm running varnish 3.0.2-1.el5 (x86_64) and just starting to try out
the range support feature. However, it doesn't appear to be working
for me, and I'm hoping someone can point me in the right direction.
param.show shows:
http_range_support on [bool]
Directly loading from the backend, I see expected responses:
curl -v -i -r 0-10 -H 'Host: testhost' -s
"http://backendip/audio/file.mp3?4" 2>&1 |head -n 20
* About to connect() to backendip port 80 (#0)
* Trying backendip... connected
* Connected to backendip (backendip) port 80 (#0)
> GET file.mp3?4 HTTP/1.1
> Range: bytes=0-10
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Accept: */*
> Host: testhost
>
< HTTP/1.1 206 Partial Content
< Date: Sun, 04 Mar 2012 22:27:51 GMT
< Server: Apache/2.2.3 (CentOS)
< Cache-Control: public, max-age=3600, must-revalidate, no-transform
< Expires: Sun, 04 Mar 2012 23:27:51 +0000
< X-Internal-TTL: 3600
< X-External-Cache-Control: public, max-age=3600, must-revalidate, no-transform
< X-Cache-Policy: manual
< Accept-Ranges: bytes
< Content-Range: bytes 0-10/1489040
< Content-Length: 11
Loading via Varnish, I see:
curl -v -i -r 0-10 -H 'Host: testhost' -s
"http://varniship/file.mp3?4" 2>&1 |head -n 20
* About to connect() to varniship port 80 (#0)
* Trying varniship... connected
* Connected to varniship (varniship) port 80 (#0)
> GET /file.mp3?4 HTTP/1.1
> Range: bytes=0-10
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Accept: */*
> Host: testhost
>
< HTTP/1.1 206 Partial Content
< Server: Apache/2.2.3 (CentOS)
< Cache-Control: public, max-age=3600, must-revalidate, no-transform
< Expires: Sun, 04 Mar 2012 23:30:05 +0000
< X-Internal-TTL: 3600
< X-External-Cache-Control: public, max-age=3600, must-revalidate, no-transform
< X-Cache-Policy: manual
< Accept-Ranges: bytes
< Content-Range: bytes 0-1489039/1489040
< Content-Type: audio/mp3
< Content-Length: 1489040
This is running using the default VCL supplied with the RPM (to ensure
that the non-compliance with Range wasn't something we've added in our
config). Finally, here's the varnishlog:
13 BackendOpen b default 127.0.0.1 36383 127.0.0.1 80
13 TxRequest b GET
13 TxURL b /file.mp3?4
13 TxProtocol b HTTP/1.1
13 TxHeader b User-Agent: curl/7.21.4
(universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
13 TxHeader b Accept: */*
13 TxHeader b Host: testhost
13 TxHeader b X-Forwarded-For: 192.168.33.10
13 TxHeader b X-Varnish: 960993454
13 TxHeader b Accept-Encoding: gzip
13 RxProtocol b HTTP/1.1
13 RxStatus b 206
13 RxResponse b Partial Content
13 RxHeader b Date: Sun, 04 Mar 2012 22:32:38 GMT
13 RxHeader b Server: Apache/2.2.3 (CentOS)
13 RxHeader b Cache-Control: public, max-age=3600,
must-revalidate, no-transform
13 RxHeader b Expires: Sun, 04 Mar 2012 23:32:39 +0000
13 RxHeader b X-Internal-TTL: 3600
13 RxHeader b X-External-Cache-Control: public, max-age=3600,
must-revalidate, no-transform
13 RxHeader b X-Cache-Policy: manual
13 RxHeader b Accept-Ranges: bytes
13 RxHeader b Content-Range: bytes 0-1489039/1489040
13 RxHeader b Content-Length: 1489040
13 RxHeader b Connection: close
13 RxHeader b Content-Type: audio/mp3
13 Fetch_Body b 4(length) cls 0 mklen 1
13 Length b 1489040
13 BackendClose b default
0 Debug - "lurker: 0x2aaaaac07100 604801 0"
10 SessionOpen c 192.168.33.10 63825 varniship:80
10 ReqStart c 192.168.33.10 63825 960993454
10 RxRequest c GET
10 RxURL c /file.mp3?4
10 RxProtocol c HTTP/1.1
10 RxHeader c Range: bytes=0-10
10 RxHeader c User-Agent: curl/7.21.4
(universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
10 RxHeader c Accept: */*
10 RxHeader c Host: testhost
10 VCL_call c recv lookup
10 VCL_call c hash
10 Hash c /file.mp3?4
10 Hash c testhost
10 VCL_return c hash
10 VCL_call c miss fetch
10 Backend c 13 default default
10 TTL c 960993454 RFC -1 -1 -1 1330900359 0 1330900358 0 0
10 VCL_call c fetch
10 TTL c 960993454 VCL 121 -1 -1 1330900358 -1
10 VCL_return c hit_for_pass
10 ObjProtocol c HTTP/1.1
10 ObjResponse c Partial Content
10 ObjHeader c Date: Sun, 04 Mar 2012 22:32:38 GMT
10 ObjHeader c Server: Apache/2.2.3 (CentOS)
10 ObjHeader c Cache-Control: public, max-age=3600,
must-revalidate, no-transform
10 ObjHeader c Expires: Sun, 04 Mar 2012 23:32:39 +0000
10 ObjHeader c X-Internal-TTL: 3600
10 ObjHeader c X-External-Cache-Control: public, max-age=3600,
must-revalidate, no-transform
10 ObjHeader c X-Cache-Policy: manual
10 ObjHeader c Accept-Ranges: bytes
10 ObjHeader c Content-Range: bytes 0-1489039/1489040
10 ObjHeader c Content-Length: 1489040
10 ObjHeader c Content-Type: audio/mp3
10 SessionClose c remote closed
10 VCL_call c deliver deliver
10 TxProtocol c HTTP/1.1
10 TxStatus c 206
10 TxResponse c Partial Content
10 TxHeader c Server: Apache/2.2.3 (CentOS)
10 TxHeader c Cache-Control: public, max-age=3600,
must-revalidate, no-transform
10 TxHeader c Expires: Sun, 04 Mar 2012 23:32:39 +0000
10 TxHeader c X-Internal-TTL: 3600
10 TxHeader c X-External-Cache-Control: public, max-age=3600,
must-revalidate, no-transform
10 TxHeader c X-Cache-Policy: manual
10 TxHeader c Accept-Ranges: bytes
10 TxHeader c Content-Range: bytes 0-1489039/1489040
10 TxHeader c Content-Type: audio/mp3
10 TxHeader c Content-Length: 1489040
10 TxHeader c Accept-Ranges: bytes
10 TxHeader c Date: Sun, 04 Mar 2012 22:32:39 GMT
10 TxHeader c X-Varnish: 960993454
10 TxHeader c Age: 0
10 TxHeader c Via: 1.1 varnish
10 TxHeader c Connection: keep-alive
10 Debug c Write error, retval = 62284, len = 1489581, errno = Success
10 ReqEnd c 960993454 1330900358.186229944
1330900359.564546108 0.000057936 0.864976168 0.513339996
10 StatSess c 192.168.33.10 63825 1 1 1 0 0 1 541 1489040
I'd be grateful if anyone who is successfully using Range can indicate
where to proceed with our debug.
Thanks,
Rob
More information about the varnish-misc
mailing list