Enabling gzip compression for Jboss

tinny picture tinny · Jun 8, 2010 · Viewed 25.7k times · Source

How is gzip compression for Jboss 5.1.0 enabled?

Within the tomcat http connector right? I cant remember where this file is stored, server.xml?

Answer

James Clarke picture James Clarke · Jun 23, 2010

edit jboss\server\default\deploy\jbossweb.sar\server.xml

Edit this:

<Connector protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}" 
           connectionTimeout="20000" redirectPort="8443" />

to be more like this:

<Connector protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}" compression="on" 
compressableMimeType="text/html,text/xml,text/css,text/javascript, application/x-javascript,application/javascript" 
connectionTimeout="20000" redirectPort="8443" />

You can refer to connector config info for further details please see: http://tomcat.apache.org/tomcat-5.5-doc/config/http.html