curl命令:
curl -X PURGE <URL>
所以可以只清除一页
如何使用CURL
清除所有缓存?
答案 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/。