I'm running a VPS with multiple different websites, and Varnish in front for caching. However, some websites should not be cached. Instead of making individual rules for each website, I would like to make a general "DON'T CACHE" list, which is linked to some rules. Possible?
In the following, I've sketched what I would like: a list of websites (ACL syntax) in the VCL configuration which should not be cached.
list cache_blacklist {
"domain1.com";
"domain2.com";
}
sub vcl_recv {
if (req.http.host ~ cache_blacklist) {
return(pass);
}
}
sub vcl_fetch {
if (req.http.host ~ cache_blacklist) {
return(hit_for_pass);
}
}
acl cache_blacklist {}however, ACL will only match withclient.id- notreq.http.host. – sqren Dec 22 '11 at 1:27