Using compression on your content can minimize the size of the content being delivered. This is done by compressing it when it is being transferred from the server and deflating it when it arrives at the client location. This is done by the following code line:
The preceding piece of code checks whether the module to compress/deflate the content is currently enabled on the server.
You might wonder if compression has a notable effect on your website? Take a look at this screenshot that I took from a website using GZIP compression.
As you can see from the screenshot, the website file size was reduced by 76.6%, which is more than half its original size. A great place to test the compression is to go to http://www.feedthebot.com/tools/gzip/ and enter your web URL.
If you're using a NGINX server, the code will be slightly different; here is a sample:
gzip on; gzip_comp_level 2; gzip_http_version 1.0; gzip_proxied any; gzip_min_length 1100; gzip_buffers 16...