Created
January 17, 2014 03:28
-
-
Save svartalf/8467918 to your computer and use it in GitHub Desktop.
Simple varnish config which will cache all responses with a X-Varnish-Age header.
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
import std; | |
backend default { | |
.host = "127.0.0.1"; | |
.port = "8000"; | |
} | |
sub vcl_recv { | |
return (lookup); | |
} | |
sub vcl_fetch { | |
if (beresp.http.x-varnish-age) { | |
set beresp.ttl = std.duration(beresp.http.x-varnish-age, 60s); | |
unset beresp.http.set-cookie; | |
unset beresp.http.vary; | |
unset beresp.http.x-varnish-age; | |
return (deliver); | |
} | |
return (hit_for_pass); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment