Tomcat7下配置gzip

server.xml 找到

1 <Connector port="8080" protocol="HTTP/1.1"
2                connectionTimeout="20000"
3                redirectPort="8443" />

替换成

1 <Connector port="8080" protocol="HTTP/1.1"
2                connectionTimeout="20000"
3                redirectPort="8443"
4                compression="on"
5                compressionMinSize="2048"
6                noCompressionUserAgents="gozilla,traviata"
7                compressableMimeType="text/html,text/xml,text/css,text/plain,text/javascript,application/x-javascript,application/javascript" />
posted @ 2012-01-06 11:24  小猩猩君  阅读(1376)  评论(0编辑  收藏  举报