vcl and cache-control header
Denis Ahrens
denis at zeno.org
Wed Apr 25 14:17:54 CEST 2007
Hi
On 24.04.2007, at 21:19, Poul-Henning Kamp wrote:
> In message <766F093C-6960-4FFB-ACA8-B014184CE85F at zeno.org>, Denis
> Ahrens writes
> :
>> Hi
>>
>> I have problems with the following vcl-script:
>>
>> if(req.http.Cache-Control == "max-age=0") {
>> set obj.ttl = 0s;
>> pass;
>> }
>
> Guys, when you quote VCL code, please also tell us which
> function you do this in...
sorry, this is in vcl_hit()
>> With this snippet in vcl-hit EVERY obj will get fetched (if there is
>> a Cache-Control header or not). Even when I change the code to
>>
>> if(req.http.Cache-Control == "thiscanbeneverfound") {
>> set obj.ttl = 0s;
>> pass;
>> }
>>
>> EVERY obj is fetched from the backend.
> Sounds bogus, can you please enable the vcl_trace parameter
> and send me a varnishlog -o output ?
I even changed it to this (the x is intentional!):
if (req.http.Cache-Controlx == "maxage=0")
{
error 200 "foo";
}
and it does not deliver anymore because the child is dying.
Cache child died pid=54760 status=0x8b
Clean child
Child cleaned
start child pid 54761
Child said (2, 54761): <<Child starts
managed to mmap 8589934592 bytes of 8589934592
Ready
CLI ready
the first req is fetched and inserted. the second request than crashes
in vcl_hit I think. But since I changed it to Cache-Controlx it should
never match.
some more output:
0 CLI Rd ping
0 CLI Wr 0 200 PONG 1177502820
0 WorkThread 0x7fffff1f7ad0 start
15 BackendOpen b vladoserver3 212.202.251.211 58294
212.202.251.213 80
15 BackendXID b 142526492
15 TxRequest b GET
15 TxURL b /Bibliothek/Pierer-1857.images/I/01_0223a.png
15 TxProtocol b HTTP/1.1
15 TxHeader b Host: www.zeno.org
15 TxHeader b Accept: */*
15 TxHeader b User-Agent: lukemftp/1.6-beta2
15 TxHeader b X-Varnish: 142526492
15 TxHeader b X-Forwarded-for: 192.168.128.215
15 RxProtocol b HTTP/1.1
15 RxStatus b 200
15 RxResponse b OK
15 RxHeader b Connection: close
15 RxHeader b Content-Type: image/png
15 RxHeader b Content-Length: 14847
15 RxHeader b Cache-control: max-age=3600, s-maxage=86400
15 RxHeader b Server: ZenoServer/1.5.16
15 RxHeader b Last-Modified: Tue, 17 Apr 2007 18:37:48 +0200
15 BackendClose b vladoserver3
12 SessionOpen c 192.168.128.215 56935
12 ReqStart c 192.168.128.215 56935 142526492
12 RxRequest c GET
12 RxURL c /Bibliothek/Pierer-1857.images/I/01_0223a.png
12 RxProtocol c HTTP/1.1
12 RxHeader c Host: www.zeno.org
12 RxHeader c Accept: */*
12 RxHeader c Connection: close
12 RxHeader c User-Agent: lukemftp/1.6-beta2
12 VCL_call c recv 1 23.1 2 26.13 6 31.9 7 31.13 9 35.9 10
35.13 11 35.38 13 39.9 14 39.13 15 40.9 16 44.9 17 44.13 19 53.9 20
53.13 22 58.9 lookup 12 VCL_call c hash 62 22.14 hash 12
VCL_call c miss 33 82.1 34 83.13 36 87.9 fetch
12 Backend c 15 vladoserver3
12 ObjProtocol c HTTP/1.1
12 ObjStatus c 200
12 ObjResponse c OK
12 ObjHeader c Content-Type: image/png
12 ObjHeader c Cache-control: max-age=3600, s-maxage=86400
12 ObjHeader c Server: ZenoServer/1.5.16
12 ObjHeader c Last-Modified: Tue, 17 Apr 2007 18:37:48 +0200
12 ObjHeader c Content-Length: 14847
12 TTL c 142526492 RFC 3600 1177502820 0 0 3600 0
12 VCL_call c fetch 37 91.1 38 92.13 40 96.9 41 96.13 43
100.9 44 100.13 46 104.9 insert
12 Length c 14847
12 TxProtocol c HTTP/1.1
12 TxStatus c 200
12 TxResponse c OK
12 TxHeader c Content-Type: image/png
12 TxHeader c Cache-control: max-age=3600, s-maxage=86400
12 TxHeader c Server: ZenoServer/1.5.16
12 TxHeader c Last-Modified: Tue, 17 Apr 2007 18:37:48 +0200
12 TxHeader c Content-Length: 14847
12 TxHeader c X-Varnish: 142526492
12 TxHeader c Age: 0
12 TxHeader c Via: 1.1 varnish
12 TxHeader c Connection: close
12 ReqEnd c 142526492 1177502820.555715303
1177502820.563157311 0.000220139 0.007398427 0.000043581
0 StatAddr 192.168.128.215 0 0 1 1 0 0 1 254 14847
12 SessionClose c Connection: close
12 StatSess c 192.168.128.215 56935 0 1 1 0 0 1 254 14847
0 CLI Rd ping
0 CLI Wr 0 200 PONG 1177502823
0 CLI Rd ping
0 CLI Wr 0 200 PONG 1177502826
0 CLI Rd vcl.load boot /tmp/vcl.9zsbFdxA
0 CLI Wr 0 200 Loaded "/tmp/vcl.9zsbFdxA" as "boot"
0 CLI Rd vcl.use boot
0 CLI Wr 0 200
0 CLI Rd start
0 CLI Wr 0 200
0 CLI Rd ping
0 CLI Wr 0 200 PONG 1177502830
More information about the varnish-dev
mailing list