Open apache or nginx webpage gzip compression

  
                  

The traffic on the website is a very valuable resource (in the case of the author's vps, the traffic is counted as money = _=!). How to save this valuable resource, minimize the amount of data transfer between the web server and the browser; reduce the cost of the website? Open web gzip compression is the best choice. The gzip compression ratio is relatively high, and it can effectively transmit less than 70% of byte data. Don't worry about browsers not supporting gzip-compressed web pages. Because almost all browsers (more than 95%) support decompressing gzip pages. In this article, I will introduce you to the commonly used server apache and nginx how to open the gzip compression function of the webpage. There is always one for you ^_^.
# BEGIN GZIP #apacheEnable gzip compression, pre-install gzip module <ifmodule mod_deflate.c> AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript </ifmodule> # END GZIP


#nginxEnable gzip compression, put in location gzip on; gzip_min_length 1000; gzip_buffers 4 8k; gzip_http_version 1.1; gzip_types text/text text/html text/plain text/xml Text/css application/x-javascript application/javascript;

If you want to know if gzip compression is successful, go to “Webmaster Tools<quo;Net to check it yourself

Copyright © Windows knowledge All Rights Reserved