Revisions
-
adamwiggins created this gist
Oct 29, 2010 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,60 @@ director routing_mesh round-robin { { .backend = { .host = "...some ip..."; .port = "...some port..."; .first_byte_timeout = 90s; .between_bytes_timeout = 90s; } # ...more backends... } } sub vcl_recv { set req.backend = routing_mesh; # POST, PUT, and DELETE are not cached if (req.request != "GET" && req.request != "HEAD") { return (pass); } # never cache when http basic auth is used if (req.http.Authorization) { return (pass); } # serve stale items for 30 seconds while fetching new item from backend set req.grace = 30s; return (lookup); } sub vcl_fetch { # cache 200s set to cache public if (obj.cacheable && obj.http.Cache-Control ~ "public") { set obj.prefetch = -30s; unset obj.http.set-cookie; return (deliver); } # everything else is served dynamically return (pass); } sub vcl_error { set obj.http.Content-Type = "text/html; charset=utf-8"; synthetic {"...error page html..."}; return (deliver); } # Disable keep-alive support with backends sub vcl_miss { set bereq.http.Connection = "close"; } sub vcl_pass { set bereq.http.Connection = "close"; } sub vcl_pipe { set bereq.http.Connection = "close"; }