Created
August 28, 2013 22:18
-
-
Save rodrigodealer/6372096 to your computer and use it in GitHub Desktop.
Simple varnish setup
This file contains 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 = "80"; | |
} | |
sub vcl_recv { | |
if(req.url ~ "sign_in" || req.url ~ "sign_out" || req.request == "POST" || req.request == "PUT" || req.request == "DELETE") { | |
return (pass); | |
} | |
return (lookup); | |
} | |
sub vcl_fetch { | |
# if(req.url ~ "logout" || req.url ~ "/users/sign_out"){ | |
# unset beresp.http.Set-Cookie; | |
# } | |
if (req.request == "GET") { | |
unset beresp.http.Set-Cookie; | |
# set beresp.cacheable = true; | |
set beresp.ttl = 360m; | |
} | |
if (req.url ~ "images/" || req.url ~ "javascripts" || req.url ~ "stylesheets" || req.url ~ "assets"){ | |
set beresp.ttl = 360m; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment