From: CKAN data.gov.au Date: Wed, 25 Sep 2013 09:26:40 +0000 Subject: add varnish config to ignore locales X-Git-Url: https://maxious.lambdacomplex.org/git/?p=ckanext-datagovau.git&a=commitdiff&h=9f64ed1f3b815f474681a119d41cbbaf32da15b8 --- add varnish config to ignore locales --- --- a/admin/default.vcl +++ b/admin/default.vcl @@ -34,6 +34,17 @@ } } } +sub vcl_hash { + # http://serverfault.com/questions/112531/ignoring-get-parameters-in-varnish-vcl + set req.url = regsub(req.url, "/../|/.._../", "/"); + hash_data(req.url); + if (req.http.host) { + hash_data(req.http.host); + } else { + hash_data(server.ip); + } + return (hash); +} sub vcl_deliver { if (!resp.http.Vary) { set resp.http.Vary = "Accept-Encoding";