Skip to content

Instantly share code, notes, and snippets.

View alexisbellido's full-sized avatar

Alexis Bellido alexisbellido

View GitHub Profile
@alexisbellido
alexisbellido / django.vcl
Created August 16, 2012 18:21 — forked from ghughes/django.vcl
Django VCL for Varnish
sub vcl_recv {
# unless sessionid/csrftoken is in the request, don't pass ANY cookies (referral_source, utm, etc)
if (req.request == "GET" && (req.url ~ "^/static" || (req.http.cookie !~ "sessionid" && req.http.cookie !~ "csrftoken"))) {
remove req.http.Cookie;
}
# normalize accept-encoding to account for different browsers
# see: https://www.varnish-cache.org/trac/wiki/VCLExampleNormalizeAcceptEncoding
if (req.http.Accept-Encoding) {
if (req.http.Accept-Encoding ~ "gzip") {