Skip to content

Commit

Permalink
Let Varnish use sane defaults when it comes to GZIP handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiasgeniar committed Jul 29, 2016
1 parent 1489fd6 commit 3593788
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions default.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ sub vcl_recv {

# Normalize the header, remove the port (in case you're testing this on various TCP ports)
set req.http.Host = regsub(req.http.Host, ":[0-9]+", "");

# Remove the proxy header (see https://httpoxy.org/#mitigate-varnish)
unset req.http.proxy;

Expand Down Expand Up @@ -317,7 +317,6 @@ sub vcl_backend_response {
if (bereq.url ~ "^[^?]*\.(7z|avi|bz2|flac|flv|gz|mka|mkv|mov|mp3|mp4|mpeg|mpg|ogg|ogm|opus|rar|tar|tgz|tbz|txz|wav|webm|xz|zip)(\?.*)?$") {
unset beresp.http.set-cookie;
set beresp.do_stream = true; # Check memory usage it'll grow in fetch_chunksize blocks (128k by default) if the backend doesn't send a Content-Length header, so only enable it for big objects
set beresp.do_gzip = false; # Don't try to compress it for storage
}

# Sometimes, a 301 or 302 redirect formed via Apache's mod_rewrite can mess with the HTTP port that is being passed along.
Expand Down

0 comments on commit 3593788

Please sign in to comment.