Created
September 23, 2011 12:57
-
-
Save erich/1237268 to your computer and use it in GitHub Desktop.
Varnish configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backend default { | |
.host = "127.0.0.1"; | |
.port = "6000"; | |
} | |
sub vcl_recv { | |
if (req.request == "PURGE") | |
{ | |
return(lookup); | |
} | |
if (req.request == "GET" && !(req.url ~ "(users|admin|refinery|dialog)")) | |
{ | |
unset req.http.Cookie; | |
set req.grace = 120s; | |
return (lookup); | |
} | |
} | |
sub vcl_fetch { | |
if (req.request == "GET" && !(req.url ~ "(users|admin|refinery|dialog)")) | |
{ | |
set beresp.ttl = 24h; | |
set beresp.grace = 120s; | |
unset beresp.http.Set-Cookie; | |
#return(pass); | |
return(deliver); | |
} | |
} | |
sub vcl_hit { | |
if(req.request == "PURGE") | |
{ | |
purge_url(req.url); | |
error 200 "Purged"; | |
} | |
if(!obj.cacheable) | |
{ | |
return(pass); | |
} | |
} | |
sub vcl_miss { | |
if(req.request == "PURGE") | |
{ | |
error 200 "Not in cache"; | |
} | |
return(fetch); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment