2017-08-30 16:45:40   Visit  82

修改tomcat目录下conf文件夹中的server.xml

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" 
               compression="on"   
               compressionMinSize="50" 
               noCompressionUserAgents="gozilla, traviata"   
               compressableMimeType="text/css,text/html,text/xml,text/javascript,text/css,text/plain,application/javascript"

压缩效果

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/javascript;charset=UTF-8
Transfer-Encoding: chunked
Content-Encoding: gzip
Vary: Accept-Encoding
Date: Wed, 30 Aug 2017 08:44:05 GMT
©2017 Leechg.com