Skip to content

Commit

Permalink
Merge pull request mattiasgeniar#20 from LukeHandle/patch-2
Browse files Browse the repository at this point in the history
Normalize Accept-Encoding is done already in v4
  • Loading branch information
mattiasgeniar committed Sep 17, 2015
2 parents b6deeec + f4c4c87 commit 557cd05
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions default.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -149,25 +149,6 @@ sub vcl_recv {
unset req.http.cookie;
}

# Normalize Accept-Encoding header
# straight from the manual: https://www.varnish-cache.org/docs/3.0/tutorial/vary.html
# TODO: Test if it's still needed, Varnish 4 now does this by itself if http_gzip_support = on
# https://www.varnish-cache.org/docs/trunk/users-guide/compression.html
# https://www.varnish-cache.org/docs/trunk/phk/gzip.html
if (req.http.Accept-Encoding) {
if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|tbz|mp3|ogg)$") {
# No point in compressing these
unset req.http.Accept-Encoding;
} elsif (req.http.Accept-Encoding ~ "gzip") {
set req.http.Accept-Encoding = "gzip";
} elsif (req.http.Accept-Encoding ~ "deflate") {
set req.http.Accept-Encoding = "deflate";
} else {
# unkown algorithm
unset req.http.Accept-Encoding;
}
}

if (req.http.Cache-Control ~ "(?i)no-cache") {
#if (req.http.Cache-Control ~ "(?i)no-cache" && client.ip ~ editors) { # create the acl editors if you want to restrict the Ctrl-F5
# http://varnish.projects.linpro.no/wiki/VCLExampleEnableForceRefresh
Expand Down

0 comments on commit 557cd05

Please sign in to comment.