@ Author YHC
Tomcat version requirements: 5.0 +
Step 1: Find your $ {tomcat}/conf/server. xml. Note: $ {tomcat} indicates your tomcat installation path.
Step 2: open the file and add the following red line labeling options:
The above code is explained:
[Plain]
Compression = "on" enable tomcat compression
CompressionMinSize = "10" The minimum size of the file to be compressed is KB.
NoCompressionUserAgents = "gozilla, traviata" does not perform gzip compression for browser types configured separated by commas (,)
CompressableMimeType = "text/html, text/xml, text/javascript, text/css, text/plain" compression is required
Compression = "on" enable tomcat compression
CompressionMinSize = "10" The minimum size of the file to be compressed is KB.
NoCompressionUserAgents = "gozilla, traviata" does not perform gzip compression for browser types configured separated by commas (,)
CompressableMimeType = "text/html, text/xml, text/javascript, text/css, text/plain" the tomcat configuration that requires compression is complete. the following content is the configuration of gzip filter. You can implement it by yourself, but here I am using the tk-filers tool, which will provide download at the very bottom;