nginx网站开启Gzip压缩功能
程序员文章站
2022-06-22 11:34:22
记录:nginx 开启Gzip压缩功能 # GZip压缩 gzip on; gzip_comp_level 6;# 压缩等级,等级越高,压缩率越大 gzip_min_length 1k; gzip_types text/plain text/css text/xml text/javascript text/x-component application/json application/javascript application...
记录:nginx 开启Gzip压缩功能
# GZip压缩
gzip on;
gzip_comp_level 6; # 压缩等级,等级越高,压缩率越大
gzip_min_length 1k;
gzip_types text/plain text/css text/xml text/javascript text/x-component application/json application/javascript application/x-javascript application/xml application/xhtml+xml application/rss+xml application/atom+xml application/x-font-ttf application/vnd.ms-fontobject image/svg+xml image/x-icon font/opentype;
提示:若https配置中已经开启Brotli压缩,由于Brotli压缩的优先级大于Gzip压缩,所以默认会使用Brotli压缩。
利用通过浏览器的开发者工具,判断网站是否开启了Gzip:
本文地址:https://blog.csdn.net/weixin_43652106/article/details/107881348