开启Gzip压缩功能后,服务对资源进行Gzip压缩后返回,缩小传输文件大小,提升文件传输效率,减少带宽消耗。
1234
#是否开启压缩,默认为falseserver.compression.enabled=true#指定要压缩的MIME typeserver.compression.mime-types=text/*,image/*,application/javascript,application/xml,application/x-font-ttf,application/font-woff
12345678910
server.xml<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" compression="on" compressionMinSize="2048" noCompressionUserAgents="gozilla, traviata" compressableMimeType="text/*,image/*,application/javascript,application/xml,application/x-font-ttf,application/font-woff"/>
To be a better man.