How to enable Nginx gzip compression

V Records 1,579 Views No comment

After the server is configured, you also need to enable gzip to compress the returned data to speed up the loading of the site.

Here’s how to enable gzip on Nginx (add it to the configuration file):

More detailed configuration reference:

how to set the gzip compression level?This will be more confusing.Someone did the test:

text/html – phpinfo():

application/x-javascript – jQuery 1.8.3 (Uncompressed):

It can be seen that when the compression level is greater than 1, the effect slowly declines. It is recommended to use compression level 2.

Some tools that can be used for testing:

This article was first published by V on 2018-10-06 and can be reprinted with permission, but please be sure to indicate the original link address of the article :

Leave a Reply

Your email address will not be published. Required fields are marked *