Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P7201
cache-text-misc.vcl
Active
Public
Actions
Authored by
•
ema
on Jun 1 2018, 1:19 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F18650647: cache-text-misc.vcl
Jun 1 2018, 1:19 PM
2018-06-01 13:19:05 (UTC+0)
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
}
Event Timeline
•
ema
created this paste.
Jun 1 2018, 1:19 PM
2018-06-01 13:19:05 (UTC+0)
Log In to Comment