I have varnish 3.0.5 up and running, connecting to a Plone 4 backend. My requests are cached, but not purged reliably, actually only after expiration of the ttl. plone.app.caching is the addon, which sends a purge request, every time an object is modified. This is the varnishlog:
14 BackendOpen b backend_0 127.0.0.1 54428 127.0.0.1 9088
14 BackendXID b 1585950387
14 TxRequest b PURGE
14 TxURL b /VirtualHostBase/https/example.com/path/VirtualHostRoot/pic/a.jpg
14 TxProtocol b HTTP/1.1
14 TxHeader b Host: localhost:9081
14 TxHeader b X-Varnish: 1585950387
14 BackendClose b backend_0
13 ReqStart c 127.0.0.1 56614 1585950387
13 RxRequest c PURGE
13 RxURL c /VirtualHostBase/https/example.com/path/VirtualHostRoot/pic/a.jpg
13 RxProtocol c HTTP/1.1
13 RxHeader c Host: localhost:9081
13 VCL_call c recv pipe
13 VCL_call c hash
13 Hash c /VirtualHostBase/https/example.com/path/VirtualHostRoot/pic/a.jpg
13 VCL_return c hash
13 VCL_call c pipe pipe
13 Backend c 14 backend_0 backend_0
13 ReqEnd c 1585950387 1412603444.714001656 1412603505.824758053 0.000071526 0.000180483 61.110575914
Within default.vcl I have configured acl purgers, basic vcl_hit and vcl_miss functions, and inside of vcl_recv I have:
if (req.request == "PURGE") {
if (!client.ip ~ purge) {
error 405 "This IP is not allowed to send purge requests.";
}
return (lookup);
}
When I open the image after purging, I still get the old version, until max age has expired. This is the shortened log output:
3 RxURL c /VirtualHostBase/https/example.com:443/path/VirtualHostRoot/pic/a.jpg
3 RxProtocol c HTTP/1.0
3 RxHeader c Host: enertour.bz.it
3 VCL_call c recv lookup
3 VCL_call c hash
3 Hash c /VirtualHostBase/https/example.com/path/VirtualHostRoot/pic/a.jpg
3 VCL_return c hash
3 Hit c 1585950403
3 VCL_call c hit deliver
3 VCL_call c deliver deliver
3 TxHeader c Cache-Control: max-age=0, s-maxage=240, must-revalidate
3 TxHeader c X-Cache-Rule: plone.content.file
3 TxHeader c Age: 181
What I've done until now is rewriting the hash value of the request, to match the hash of the purge request. They are identical, but my object is not purged and I can't figure out why? Is it because the requesting host changes?
Glad about any hints!