修改server.xml,找到“ <Connector connectionTimeout="20000" port="808x" protocol="HTTP/1.1" redirectPort="8443"/>”,添加:“ compression="on" compressableMimeType="text/html,text/xml,text/css,text/javascript,text/plain"”,重启tomcat,配置即生效