Skip to content

Commit

Permalink
nginx: use a compression level of 5 in recommended configuration
Browse files Browse the repository at this point in the history
While there is little gain of space to use a compression level of 9,
the CPU usage is significant. Many experiments point to use something
between 4 and 6. For example:

 - https://mjanja.ch/2015/03/finding-the-nginx-gzip_comp_level-sweet-spot/
 - https://github.com/h5bp/server-configs-nginx/blob/3bda5b93edba147d51760e900c2079828a7dc274/nginx.conf#L93
  • Loading branch information
vincentbernat committed Aug 26, 2018
1 parent b2da2df commit 06a5fb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nixos/modules/services/web-servers/nginx/default.nix
Expand Up @@ -92,7 +92,7 @@ let
gzip on;
gzip_disable "msie6";
gzip_proxied any;
gzip_comp_level 9;
gzip_comp_level 5;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
gzip_vary on;
''}
Expand Down

0 comments on commit 06a5fb2

Please sign in to comment.