Last active
December 19, 2015 12:19
-
-
Save kesor/5953739 to your computer and use it in GitHub Desktop.
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 = "8080"; | |
} | |
sub vcl_recv { | |
if (req.request == "POST") { | |
return (pipe); | |
} | |
if (req.url ~ "^/(s/|favicon.ico|download/resources/|download/batch/|images/icons/)") { | |
set req.http.X-Static = "yes"; | |
remove req.http.User-Agent; | |
remove req.http.Cookie; | |
remove req.http.Referer; | |
return (lookup); | |
} | |
return (pass); | |
} | |
sub vcl_fetch { | |
if (req.http.X-Statis == "yes") { | |
remove beresp.http.Set-Cookie; | |
} | |
return (deliver); | |
} | |
sub vcl_hash { | |
set req.url = regsub(req.url, "[?&]_=\d+", ""); | |
set req.url = regsub(req.url, "^/s/en_US.[^-]*-", "/s/en_US-x-"); | |
hash_data(req.url); | |
return (hash); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment