The nginx I use is 1.6. gzip is written in the configuration file. See below
gzip on;
gzip_min_length 1k;
gzip_buffers 16 64k;
gzip_http_version 1.1;
gzip_comp_level 9;
gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary on;
But I used the online testing tool http://gtmetrix.com/ to test. Only the css was compressed and the js was not compressed (the same is true for the domestic webkaka speed test). How strange.
I asked many people, but no one knows. Could it be due to my configuration? Thanks!
⊙﹏⊙b汗,加上application/javascript就OK了。我怎么在网上贴的代码里边没有这个!找了半天!