Enable GZIP for CSS and JS files on NGINX server for Magento

后端 未结 5 1854
醉话见心
醉话见心 2021-01-30 00:08

I need to enable gzip compression on nginx server. As I have observed from firfox firebug NET tools, I have found that html file are gzip compressed. But Not the javascript fil

5条回答
  •  说谎
    说谎 (楼主)
    2021-01-30 00:36

    This is an working config that I currently use in production.

    http://pastie.org/10870547

    gzip on;
    gzip_disable "msie6";
    
    gzip_comp_level 6;
    gzip_min_length 1100;
    gzip_buffers 16 8k;
    gzip_proxied any;
    gzip_types
        text/plain
        text/css
        text/js
        text/xml
        text/javascript
        application/javascript
        application/json
        application/xml
        application/rss+xml
        image/svg+xml;
    

    This config was tested via tools.pingdom.com.

提交回复
热议问题