diff --git a/HowtoVarnish.md b/HowtoVarnish.md index 442dd31b..b21c44a7 100644 --- a/HowtoVarnish.md +++ b/HowtoVarnish.md @@ -339,15 +339,7 @@ Le temps de mise en cache par défaut peut être défini avec l'option `-t` à [ sub vcl_backend_response { set beresp.ttl = 1800s; #unset beresp.http.expires; - set beresp.http.cache-control = "max-age=1800"; - set beresp.http.magicmarker = "1"; -} - -sub vcl_deliver { - if (resp.http.magicmarker) { - unset resp.http.magicmarker; - set resp.http.age = "0"; - } + set beresp.http.Cache-Control = "max-age=1800"; } ~~~ @@ -362,6 +354,17 @@ sub vcl_recv { if (req.http.Cookie ~ "(VARNISH|DRUPAL_UID)") { return (pass); } + + if (req.http.cookie) { + set req.http.Cookie = regsuball(req.http.Cookie, "_gat=[^;]+(; )?", ""); # Google Analytics + set req.http.Cookie = regsuball(req.http.Cookie, "_ga=[^;]+(; )?", ""); # Google Analytics + set req.http.Cookie = regsuball(req.http.Cookie, "_gaq=[^;]+(; )?", ""); # Google Analytics + set req.http.Cookie = regsuball(req.http.Cookie, "__utm[^=]*=[^;]+(; )?", ""); # Google Analytics + + if (req.http.cookie ~ "^ *$") { + unset req.http.cookie; + } + } } sub vcl_backend_response {