Enable gzip in nginx

Gzip is a common unix tool for compressing files. It can be used by the server to compress your web pages before sending them to the client, potentially cutting the file size in half.

Settings are already available in the default config at /etc/nginx/ngix.conf, you just need to uncomment these lines:

gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

 

This will help you get a better score on a page speed test, and provide a better browsing experience to users.

Tags
Hosting