tomcat和nginx gzip压缩

<!--StartFragment -->
tomcat下gzip:
gzip在tomcat7下,如果要压缩js,需要在tomcat conf server.xml 除了要添加
compression="on"
还要添加


 
compressableMimeType="text/html,text/xml,text/plain,text/css,application/javascript"
tomcat8不需要添加下面的compressableMimeType
 
nginx下gzip:
在conf下nginx.conf文件下
#压缩
gzip on;
gzip_types text/plain text/css text/xml application/javascript;

client_max_body_size 100m;
server_tokens off;
 

猜你喜欢

转载自zihai367.iteye.com/blog/2294253