Reputation: 2160
I want to apply compression to my responses at tomcat level however it does not work. It seems like an esay protocol, however somehow I am unable to apply it. Here is my connector conf in server.xml
<Connector port="80" protocol="org.apache.coyote.http11.Http11Nio2Protocol"
maxThreads="500"
processorCache="500"
maxConnections="10000"
acceptCount="5000"
URIEncoding="UTF-8"
useSendfile="false"
compression="force"
compressionMinSize="4"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml,text/plain,text/css,text/javascript"/>
I disabled antivirus on my local macihne(Client-side) and the requests have Accept-Encoding:gzip header. Thank you in advance.
Upvotes: 1
Views: 3279
Reputation: 11
Too late but:
Note: There is a tradeoff between using compression (saving your bandwidth) and using the sendfile feature (saving your CPU cycles). If the connector supports the sendfile feature, e.g. the NIO2 connector, using sendfile will take precedence over compression. The symptoms will be that static files greater that 48 Kb will be sent uncompressed. You can turn off sendfile by setting useSendfile attribute of the protocol, as documented below, or change the sendfile usage threshold in the configuration of the DefaultServlet in the default conf/web.xml or in the web.xml of your web application.
Upvotes: 1