tomcat 增加压缩设置
Posted Beef Liu
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了tomcat 增加压缩设置相关的知识,希望对你有一定的参考价值。
conf/server.xml中,Connector的配置中添加
compression="on" compressionMinSize="512" noCompressionUserAgents="gozilla, traviata"
实际的例子:
<Connector port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol" connectionTimeout="20000" redirectPort="8443" maxHttpHeaderSize ="8192" maxThreads ="4096" minSpareThreads ="512" enableLookups ="false" acceptCount ="512" disableUploadTimeout ="true" compression="on" compressionMinSize="512" noCompressionUserAgents="gozilla, traviata" /> <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" SSLEnabled="true" connectionTimeout="20000" maxThreads="4096" maxHttpHeaderSize ="8192" minSpareThreads ="512" compression="on" compressionMinSize="512" noCompressionUserAgents="gozilla, traviata" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" ciphers="TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA" keystoreFile="${catalina.base}/keystore/xxx.p12" keystorePass="111" keystoreType="PKCS12" />
以上是关于tomcat 增加压缩设置的主要内容,如果未能解决你的问题,请参考以下文章