Enable gzip compression Jboss Server

Enable gzip compression Jboss Server

GZIP: It a file format that is used to compress or decompress files. You could optimize application performance by enabling gzip compression. This minimize size of the resources which browser has to download. To enable it on Jboss server:

  • Jboss 6.2: Go to ..\standalone\configuration\standalone.xml and add below system properties:
<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,application/json"/>
</system-properties>
  •  If you want to enable on Linux box where server install as domain then go to ../domain/configuration/domain.xml
<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,application/json"/>
</system-properties>

Validate if compression is enable or not:

  • In chrome browser open up developer tools –> go to Network tab and check size of the content:

2015-01-29 12_30_55-Hedge Activity Details ngGrid

  •  As you see above actual size 9.6 MB compress to 589 KB after enabling gzip compression.

Another way to see if gzip enable or not in browser: 

  • In chrome click response and check its header:

2015-01-29 12_33_58-Hedge Activity Details ngGrid

  •  For more details please refer Jboss documentation here

Leave a Reply

Your email address will not be published. Required fields are marked *