tomcat配置gzip压缩

	<Connector port="8072"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8022" acceptCount="100"
               debug="0" connectionTimeout="20000"
               disableUploadTimeout="true" URIEncoding="utf-8"
               compression="on"     
               compressionMinSize="2048"                                                
               noCompressionUserAgents="gozilla, traviata" 
               useSendfile="false"                              
               compressableMimeType="text/html,application/xhtml+xml,application/xml,text/xml,text/javascript,text/css,text/plain,application/x-javascript,application/javascript,text/xhtml,text/json,application/json,application/x-www-form-urlencoded,text/javaScript" />

  

特别要注意,useSendfile要配置为false,不然不会生效。

猜你喜欢

转载自www.cnblogs.com/junge8618/p/9184062.html