4

I've been a tomcat user for a long time and am now looking to start playing with tomcat 7 with a view to upgrading

We use tomcat standalone using BIO serving many static resources...so this article in your "top ten of 2010" http://www.tomcatexpert.com/blog/2010/03/24/myth-or-truth-one-should-always-use-apache-httpd-front-apache-tomcat-improve-perform was of great interest

However our current usage(Tomcat 6 + BIO) uses gzip compression like:

    <Connector executor="tomcatThreadPool" port="8080" protocol="HTTP/1.1"

               connectionTimeout="20000"

               redirectPort="9400"

               compression="on"

               compressionMinSize="2048"

               noCompressionUserAgents="gozilla, traviata"

               compressableMimeType="text/html,text/xml,text/javascript,text/css"/>

However I have noticed when perusing the documentation that both APR and NIO connector's don't have parameters / for compression. Can someone elaborate on how I can set compression in a similar fashion via server.xml / connector? If it's not available, are there any plans to incorporate this functionality?

I'm aware we can write this myself using my own gzip filters etc; however the connector approach is easier and more elegant as gzip filter's would have to be applied to all our webapps(10+ webapps in a SOA architecture)

Thanks

javaguy44
  • 41
  • 2

1 Answers1

0

I think you misunderstood the documentation. It says:

The standard HTTP connectors (BIO, NIO and APR/native) all support the following attributes in addition to the common Connector attributes listed above.

The compression property is in the "standard" list, so I would assume that all other connectors support it.

mindas
  • 26,463
  • 15
  • 97
  • 154
  • Actually, it's the opposite, compression is listed in the Standard Implementation section. – Zeki Oct 14 '14 at 20:34
  • And yet, compression is indeed in the source: http://grepcode.com/file/repository.springsource.com/org.apache.coyote/com.springsource.org.apache.coyote/6.0.24/org/apache/coyote/http11/Http11NioProtocol.java#Http11NioProtocol.getCompression%28%29 I'll try this out locally and report back. – Zeki Oct 14 '14 at 20:38