Tomcat开启gzip压缩
<Connector port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol" acceptorThreadCount="8" executor="tomcatThreadPool" URIEncoding="UTF-8" compression="on" compressableMimeType="text/html,text/css,application/javascript,text/xml,text/plain" connectionTimeout="20000" redirectPort="8443" /> |
主要是compression和compressableMimeType两行。
Tomcat7中,必须是application/javascript,而不能使text/javascript。
注意如果开启了https服务,在
Categories: Java
评论 (0)
留下评论