From 30a5744812b861fd5b8784e19ccab5255d20ce07 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Mon, 14 Nov 2016 12:46:34 +0200 Subject: [PATCH] roles/nginx: Decrease gzip_min_length from 860 to 256 There was some knowledge floating around that 860 bytes was the optimal size, I think it was from an Akamai engineer or something, but the HTML 5 Boilerplate server configs use 256 bytes, and I actually have HTML content that is less than 860 bytes, so I guess I could benefit from compressing it. gzip compression is costly for the compression side, but very quick for the client, so this is a good thing. See: https://github.com/h5bp/server-configs-nginx/blob/master/nginx.conf --- roles/nginx/files/nginx.conf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/nginx/files/nginx.conf b/roles/nginx/files/nginx.conf index 11c0df3..0f3acd7 100644 --- a/roles/nginx/files/nginx.conf +++ b/roles/nginx/files/nginx.conf @@ -63,7 +63,11 @@ http { # 75% reduction for most ASCII files (almost identical to level 9). gzip_comp_level 5; - gzip_min_length 860; + # Don't compress anything that's already small and unlikely to shrink much + # if at all (the default is 20 bytes, which is bad as that usually leads to + # larger files after gzipping). + gzip_min_length 256; + gzip_disable "msie6"; gzip_http_version 1.1; # Compress all output labeled with one of the following MIME-types.