Nginx enables gzip compression on a website, which not only saves bandwidth, but also responds to user access quickly. in nginx, gzip compression is enabled by www.2cto. comgzipon; (enable gzip compression) gzip_proxieda...
Nginx enables gzip compression on a website, which not only saves bandwidth, but also responds to user access quickly. in nginx, The gzip compression method is www.2cto.com gzip on; (enable gzip compression) gzip_proxied any; (enable this option when nginx is used as a front-end proxy, indicating that compression is enabled unconditionally no matter what information is returned by the backend server's headers header) gzip_min_length 1024; (for the page with the minimum compression, if the page is too small, it may increase the pressure. compression is enabled only for pages larger than 1 k.) gzip_buffers 4 8 k; (set the system to obtain several units of cache for storing gzip compressed result data streams) gzip_comp_level 3; (compression level, 1 compression ratio, minimum processing speed, 9 compression ratio, but processing slowest, at the same time, it also consumes the most CPU resources. generally, it can be set to 3.) gzip_types text/plain text/css application/x-javascript application/xml; after the configuration is complete, run the following command: www.2cto.com curl-I-H "Accept-Encoding: gzip, deflate "" http://yourhoust.com "HTTP/1.1 200 OKServer: nginx Date: Tue, 17 Jul 2012 07:08:04 GMTContent-Type: text/html; charset = utf-8Connection: keep-aliveCache-Control: privateX-AspNet-Version: 4.0.30319X-Powered-By: ASP. NETContent-Encoding: gzip author fairplay_li
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.