Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enabling gzip compression for Jboss

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?

like image 611
tinny Avatar asked Jun 08 '10 02:06

tinny


People also ask

How do I enable gzip on my server?

Gzip on Windows Servers (IIS Manager)Open up IIS Manager. Click on the site you want to enable compression for. Click on Compression (under IIS) Now Enable static compression and you are done!

How do you check gzip compression is enabled or not?

Double click on the file and select headers. Under 'Response headers' you are looking for the 'Connection-Encoding' field, it will say gzip if it is enabled. NOTE: By default, Deflate is enabled on all of our servers.

Is gzip enabled by default?

All modern browsers include support for GZIP compression by default. However, to serve the compressed resources to your users with no hiccups, you must configure your server properly.


2 Answers

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

like image 106
James Clarke Avatar answered Oct 02 '22 09:10

James Clarke


To add gzip compression in JBoss 7.1.1, you can edit standalone/configuration/standalone.xml and add:

       ...
    </extensions>

    <system-properties>
        <property name="org.apache.coyote.http11.Http11Protocol.COMPRESSION" value="on"/>
        <property name="org.apache.coyote.http11.Http11Protocol.COMPRESSION_MIME_TYPES" value="text/javascript,text/css,text/html"/>
    </system-properties>

Restart the server and check with developer tools or in the HTTP header if it is enabled.

like image 31
nimrod Avatar answered Oct 02 '22 09:10

nimrod