Gzip压缩

2022-09-17  本文已影响0人  码农私房菜

Gzip动态压缩

location / {
    #-----------------------------
    # 开启静态资源解压缩(两个配合使用)
    gunzip on;
    gzip_static always;
    #-----------------------------
    gzip on;
    gzip_buffers 16 8k;
    gzip_comp_level 6;
    gzip_http_version 1.1;
    gzip_min length     256;
    gzip_proxied any;
    gzip_vary on;
    # gzip_types text/plain application/x-javascript text/css application/xml;
    gzip_types
          text/xmit application/xml application/atom+xml application/rss+xml   application/xhtml+xml image/svg+xml
          text/javascript application/javascript application/x-javascript
          text/x-json applicationjson application/x-web-app-manifest+json
          text/css text/plain text/x-component
          font/opentype application/x-font-ttf application/vnd.ms-fontobject
          image/x-icon;
    gzip_disable-MSIE[1-6]WA(?!."SV1)"; (尽量不配这项,避免影响性能)
}
上一篇下一篇

猜你喜欢

热点阅读