How to set gcip tomcat maximum compression size?

I am setting up tomcat to compress text files. My current configuration:

compression="on"
compressableMimeType="text/html,text/xml,text/plain,text/css,text/javascript,application/xml,application/x-javascript,application/json"

However, I notice that a javascript file larger than ~ 60kb does not compress. Are there any hidden settings?

+5
source share
1 answer

Documentation search for tomcat7 I can not find the link to compressionMaxSize. The only command like this is compressionMinSizeone that is designed to filter the compression of any file smaller than a specific value. For instance:

compressionMinSize="2048"

Here is what my server.xml looks like with regard to compression:

compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml"

There is actually a hidden piece of documentation related to this that explains your experience:

. ( ) sendfile ( ). sendfile, . NIO, sendfile . , , 48 uncompressed. sendfile, useSendfile , , sendfile DefaultServlet conf/web.xml web.xml -.

, , , web.xml(, ):

<init-param>
    <param-name>sendfileSize</param-name>
    <param-value>96</param-value> <!-- value in KB where compression is turned off in the name of CPU utilization -->
</init-param>
+10
source

All Articles