Page MenuHomePhabricator
Paste P7201

cache-text-misc.vcl
ActivePublic

Authored by ema on Jun 1 2018, 1:19 PM.
Tags
None
Referenced Files
F18650647: cache-text-misc.vcl
Jun 1 2018, 1:19 PM
Subscribers
None
// somewhere in modules/varnish/files/reload-vcl
// vcl.load vcl_misc /somewhere/cache-misc.vcl
// vcl.label cache_misc_label vcl_misc
// cache-text.vcl
sub vcl_init {
new hostmatch = re2.set(anchor=both, case_sensitive=false, literal=true);
hostmatch.add("15.wikipedia.org");
hostmatch.add("analytics.wikimedia.org");
hostmatch.add("annual.wikimedia.org");
// [...]
hostmatch.compile();
}
sub vcl_recv {
if (hostmatch.match(req.http.Host)) {
// cache_misc
return (vcl(cache_misc_label));
}
// regular cache_text vcl here
}