2 minutes read

During Speed testing of your website or web application using LoadFocus (https://loadfocus.com/website-speed-testing) on the Advice section you might get the tip that you need to enable compression like in the image below:

 

advice_enable_compression

 

Compressing responses often significantly reduces the size of transmitted data.
Because the compression happens at runtime this can add a big processing overhead which can affect the performance in a negative way.

Nginx if configured correctly compresses the responses before sending them to the clients and does not double compress the responses which have been already compressed.

In the next tutorial we will show how you can enable compression in case you are using Nginx to serve your files.

1. First locate the Nginx configuration file – nginx.conf
2. Once you located the file open the file and make sure that inside the configuration you can find the following flags:


gzip on;
gzip_disable "msie6";


gzip_vary on;
gzip_proxied any;
gzip_comp_level 5;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 1000;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

3. Explanation of the flags:


LoadFocus.com is a Cloud Testing Platform used for Load and Performance Testing for Websites and APIs and Website Speed Testing with Analytics.

How fast is your website? Free Website Speed Test