In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is to share with you about how to enable gzip compression in Nginx, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
After the server has done some configuration, there is one more thing to do: enable gzip to compress the returned data to speed up the loading of the Web site.
The following are the relevant configurations for enabling gzip on Nginx (just add it to the profile):
# enable gzipgzip on; # enable gzip compression of the minimum files, files less than the set value will not compress gzip_min_length 1k; # gzip compression level, 1-10, the larger the number, the better compression, and the more time it takes up CPU. Gzip_comp_level 2; # the type of file that is compressed. Whether gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml font/ttf font/otf; # adds Vary: Accept-Encoding to http header, it is recommended to enable gzip_vary on; # disable IE 6 gzipgzip_disable "MSIE [1-6]\."
One of the more confusing do not know how to set the compression level. Someone has tested the compression level, and the specific data are as follows:
Text/html-phpinfo ():
0 55.38 KiB (100.008% of original size) 1 11.22 KiB (20.26% of original size) 2 10.89 KiB (19.66% of original size) 3 10.60 KiB (19.14% of original size) 4 10.17 KiB (18.36% of original size) 59.79 KiB (17.68% of original size) 69.62 KiB (17.37% of original size) 7 9.50 KiB (17.15% of original size) 8 9.45 KiB (17.06% of original size) 9.44 KiB (17.05% of original size)
Application/x-javascript-jQuery 1.8.3 (Uncompressed):
0 261.46 KiB (100.004% of original size) 1 95.01 KiB (36.34% of original size) 290.60 KiB (34.65% of original size) 3 87.16 KiB (33.36% of original size) 481.89 KiB (31.32% of original size) 5 79.33 KiB (30.34% of original size) 6 78.04 KiB (29.85% of original size) 7 77.85 KiB (29.78% of original size) 8 77.74 KiB (29. 73% of original size) 9 77.75 KiB (29.74% of original size) above is how to enable gzip compression in Nginx The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.