标签:tomcat
要使用gzip压缩功能,可以在Connector实例中加上如下属性:
1) compression="on" 打开压缩功能
2) compressionMinSize="2048" 启用压缩的输出内容大小,这里面默认为2KB
3) noCompressionUserAgents="gozilla, traviata" 对于以下的浏览器,不启用压缩&<60;
4) compressableMimeType="text/html,text/xml" 压缩类型
修改完成后:
<Connector
port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true"
compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla,traviata"
compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain" />
打开tomca t的Gzip 压缩进行优化,布布扣,bubuko.com
标签:tomcat
原文地址:http://8917152.blog.51cto.com/8907152/1412576