Last active
January 27, 2016 03:35
-
-
Save section-io-gists/1547e67e1791c884699a to your computer and use it in GitHub Desktop.
section.io VCL - Starter Config
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
#section.io VCL sample. Copy paste into your section.io account to implement instantly | |
#vcl_recv - copy this code into the section called sub vcl_recv | |
if (req.url ~ ".*\.(?:css|js|jpe?g|png|gif|ico|swf)(?=\?|&|$)") { | |
unset req.http.Cookie; | |
#Varnish <= 3.x calls this "return (lookup);" | |
return (hash); | |
} | |
#vcl_backend_response - copy this code into the section called sub vcl_backend_response | |
#Varnish <= 3.x calls this "vcl_fetch" instead of "vcl_backend_response" | |
if (beresp.status < 400){ | |
if (bereq.url ~ ".*\.(?:css|js|jpe?g|png|gif|ico|swf)(?=\?|&|$)") { | |
set beresp.ttl = 28800s; #The number of seconds to cache inside Varnish | |
set beresp.http.Cache-Control = "max-age=28800"; #The number of seconds to cache in browser | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment