In this post we will configure the gzip compression with Apache Tomcat 8.
Step 1: Open the server.xml
sudo vim server.xml
and locate the virtual-host configuration and adjust the gzip compression like this.
<Connector port=“8080” protocol=“HTTP/1.1”
connectionTimeout=“20000”
compression=“on”
compressionMinSize=“8192”
useSendfile=“false”
compressableMimeType=“text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,text/json,application/json”
redirectPort=“8443” />
Save and restart the apache tomcat process.
Gzip Compression with Tomcat