Tomcat web compression configuration

Compression of output content is supported for later versions of Tomcat5.0, using gZIP compression format
Modify %TOMCAT_HOME%/conf/server.xml, the first Connector node of the file. The specific node to be modified is as follows:
< The Connector port = “80” protocol = “HTTP/1.1”
ConnectionTimeout = “20000”
The redirectPort = “8443”/& gt;
The modified code is as follows:
< The Connector port = “80” protocol = “HTTP/1.1”
ConnectionTimeout = “20000”
The redirectPort = “8443” URIEncoding = “utf-8”
Compression will = “on” compressionMinSize = “2048”
NoCompressionUserAgents = “gozilla, traviata”
CompressableMimeType = “text/HTML, text/XML, text/javascript,
Text/CSS, text/plain “/ & gt;
The following attributes have been added
1. Compression = “on”
2. CompressionMinSize = “2048” with compressed output content size enabled, which is 2KB by default
3. NoCompressionUserAgents = “gozilla, traviata” browsers to be excluded;
4, compressableMimeType = “text/HTML, text/XML, text/javascript, text/CSS, text/plain” compression type
After the modification, restart Tomcat, and finally check the website.

Read More: