Performance is very important to save resource for visitors using our website.
If you deploy your Java Web Application on Apache Tomcat and you feel it’s a bit slow, please check it out my experience on solving issue of gzip compression by changing configuration of Apache Tomcat.
Result: Before/After Correction
Solutions
- Edit file: apache-tomcat-xx\conf\server.xml change setting connection from:
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>
- To add some lines as following:
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" compression="on" compressionMinSize="10" noCompressionUserAgents="gozilla, traviata" compressableMimeType="text/html,text/xml,text/javascript,text/css"/>
Tips & Warning
You need to restart your tomcat server for any change of configuration file such as server.xml file.