漆。如何清理curl上的所有缓存

时间:2016-03-13 11:12:15

标签: caching curl varnish

curl命令:

curl -X PURGE <URL>  

所以可以只清除一页

如何使用CURL清除所有缓存?

2 个答案:

答案 0 :(得分:0)

添加此VCL,然后您可以使用“curl -X BANRE”。清除缓存。

sub vcl_recv {
        if (req.method == "BANRE") {
                # Same ACL check as above:
                if (!client.ip ~ purge) {
                        return(synth(403, "Not allowed."));
                }
                ban("req.url ~ " + req.url).
                return(synth(200, "Ban added"));
        }
}

答案 1 :(得分:0)

(清漆3)我能够清除所有缓存

if (req.request == "BAN") {
 if (!client.ip ~ purge) {
 # Not from an allowed IP? Then die with an error.
 error 405 "This IP is not allowed to send PURGE requests.";
 }
 ban("req.http.host == " +req.http.host+" && req.url ~ "+req.url);
 error 200 "Ban added";
 }

curl -X BAN http://domain.com/