清漆不清除我的请求由Plone发送

我有清漆3.0.5和运行,连接到一个Plone 4后端。 我的请求被caching,但不能可靠地清除,实际上只有在ttl到期之后。 plone.app.caching是插件,每次修改对象时都会发送一个清除请求。 这是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 

在default.vcl中我已经configuration了acl purgers,基本的vcl_hit和vcl_miss函数,并且在vcl_recv里面我有:

 if (req.request == "PURGE") { if (!client.ip ~ purge) { error 405 "This IP is not allowed to send purge requests."; } return (lookup); } 

清除后打开图像时,我仍旧得到旧版本,直到最大年龄过期。 这是缩短的日志输出:

 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 

我到现在为止所做的是重写请求的哈希值,以匹配清除请求的哈希值。 他们是相同的,但我的对象是不清除,我不明白为什么? 是因为请求主机改变了吗?

很高兴提示!

今天再次看看我的VCL,我发现在修改过程中,清除函数在检查请求types的行的下方滑动。 因此不允许清洗,并在pipe道中完成。 正确的顺序是:

 if (req.request == PURGE) { ... return (lookup); } if (req.request != "(GET|HEAD)" { ... return (pass); }