Configurate Tomcat 8 with GZIP

2019-07-24 18:24发布

问题:

I'm trying to set GZIP in Tomcat, I've shown a lot of examples but anyone works for me. Below you can see my server.xml configuration and an example of request:

server.xml

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443"
               useSendfile="false"
               compression="force" compressionMinSize="1024" noCompressionUserAgents="gozilla, traviata"
       compressableMimeType="text/html,text/xml,text/javascript,text/css,application/javascript"/>

request:

Thanks!

回答1:

I've found the answer, I've disabled my antivirus and compression works fine.