varnishのcacheを破棄する方法
PURGEメソッドが呼ばれるとそのURLのcacheを破棄するように設定する例。aclでアクセス制限をすると良い。
# Who is allowed to purge....
acl local {
"localhost";
"192.168.1.0"/24; /* and everyone on the local network */
! "192.168.1.23"; /* except for the dialin router */
}
sub vcl_recv {
if (req.request == "PURGE") {
if (client.ip ~ local) {
return(lookup);
}
}
}