nginx brotli压缩
宝塔添加编译模块
ngx_brotli
ngx_brotli 压缩模块
–add-module=/www/server/ngx_brotli
cd /www/server
git clone https://github.com/google/ngx_brotli
cd ngx_brotli
git submodule update –init
https://github.com/google/ngx_brotli
宝塔面板网站配置添加
# brotli压缩
brotli on; #启用
brotli_comp_level 6; #压缩等级,默认6,最高11,太高的压缩水平可能需要更多的CPU
brotli_buffers 16 8k; #请求缓冲区的数量和大小
brotli_min_length 20; #指定压缩数据的最小长度
brotli_static always; #查找预处理好的、以.br结尾的压缩文件,可选值为on、off、always
brotli_window 512k; #窗口值,默认值为512k
brotli_types application/atom+xml
application/x-javascript
application/javascript
application/json
application/rss+xml
application/vnd.ms-fontobject
application/x-font-opentype
application/x-font-truetype
application/x-font-ttf
application/font-woff
application/xhtml+xml
application/xml
font/eot font/opentype
font/otf font/truetype
image/svg+xml
image/vnd.microsoft.icon
image/x-icon
image/jpeg
image/gif
image/png
image/bmp
image/svg
image/x-win-bitmap
text/css
text/javascript
text/plain
text/xml;