Skip to content
Browse files

Update the new VCL snippets for 3.0

  • Loading branch information...
1 parent f14b16b commit c49750c476bfdb5dd9925f253d861e7530a45e24 @KristianLyng KristianLyng committed Feb 23, 2012
View
8 vcl/solution-purge-from-backend.vcl
@@ -3,18 +3,18 @@ backend default {
.port = "80";
}
-acl purge {
+acl banners {
"127.0.0.1";
}
sub vcl_recv {
if (req.request == "PURGE") {
- if (!client.ip ~ purge) {
+ if (!client.ip ~ banners) {
error 405 "Not allowed.";
}
- purge("req.url == " req.url " && req.http.host == " req.http.host);
- error 200 "Purged.";
+ ban("req.url == " + req.url + " && req.http.host == " + req.http.host);
+ error 200 "Banned.";
}
/* [...] */
}
View
8 vcl/solution-vcl_fetch-enable-esi.vcl
@@ -1,15 +1,11 @@
// Yes, it is that simple :)
sub vcl_fetch {
- esi;
- /* [...] */
+ set beresp.do_esi = true;
}
/* And if you want to avoid esi.php to get cached */
sub vcl_recv {
-
if ( req.url ~ "/esi.php" ) {
return (pass);
}
-
- /* [...] */
-}
+}
View
2 vcl/solution-vcl_fetch-masquerade-ajax-requests.vcl
@@ -9,7 +9,7 @@ sub vcl_fetch {
set req.http.host = "www.google.com";
set req.url = regsub(req.url, "^/masq", "");
remove req.http.Cookie;
- return(lookup);
+ return(deliver);
}
/* [...] */
}
View
2 vcl/solution-vcl_hash-add-cookie.vcl
@@ -1,5 +1,5 @@
sub vcl_hash {
- set req.hash += req.http.Cookie;
+ hash_data(req.http.Cookie);
}
sub vcl_recv {

0 comments on commit c49750c

Please sign in to comment.
Something went wrong with that request. Please try again.