3

Connector settings:

<Connector ...
compression="2048"
noCompressionUserAgents="gozilla, traviata"
compressionMimeType="text/html,text/xml,text/plain,text/css,text/javascript"/>

This seems to work for html, but not for css or javascript. compression="force" does work, but compression="on" doesn't. compression="2" doesn't work either, so I don't know what "force" is really doing.

The files in question are about 6k, I've cleared the browser cache, etc.

  • Note that in Tomcat 7 this is the default setting, with the addition of application/javascript. – Charles Wood Dec 17 '15 at 20:59
6

You should use compressableMimeType, not compressionMimeType, so

<Connector ...
compression="1400"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType ="text/html,text/xml,text/plain,text/css,text/javascript"/>

Should do the trick.

2

http://tomcat.apache.org/tomcat-7.0-doc/config/http.html

Please use application/javascript instead of text/javascript, as given below: compressableMimeType="text/html,text/xml,text/plain,text/css,application/javascript"

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.