tomcat8启用gzip压缩

方法非常简单,只需要在Connector节点中加入以下内容即可:

1
2
3
4
5
useSendfile="false"
compression="on"   
compressionMinSize="50" 
noCompressionUserAgents="gozilla, traviata"   
compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain,application/javascript,application/x-javascript"