Performing post-installation activities
Enabling GZIP compression
Gzip compression is a part of post installation.
Enabling GZip compression in Tomcat
Navigate to {{tomcat-home}}/conf/server.xml file and add the following lines to the HTTP Connector configuration.
compression="on" useSendfile="false"
compressableMimeType="text/css,text/javascript,application/javascript"
For example, an HTTP Connector configuration with compression enabled is described as follows:
<Connector port="8080" maxHttpHeaderSize="8192"maxThreads="150" minSpareThreads="25" maxSpareThreads="75"enableLookups="false" redirectPort="8443" acceptCount="100"connectionTimeout="20000" disableUploadTimeout="true"compression="on" compressionMinSize="8192"
userSendfile="false" compressableMimeType="text/css,text/javascript,application/javascript"/>
Enabling GZip compression in Apache (Worker Environment)
Ensure that the following modules are available in {{apache-home}}/modules/*
mod_deflate.so
mod_mime_magic.so
mod_headers.so
mod_mime.so
mod_setenvif.so
Add the following to {{apache-home}}/conf/httpd.conf or cloudio.conf depending on your configuration:
LoadModule deflate_module modules/mod_deflate.so
<IfModule mime_module>
AddType application/javascript .js
AddType text/css .css
</IfModule>
<IfModule deflate_module>
AddOutputFilterByType DEFLATE text/css text/html text/plain text/xml application/javascript
<IfModule mod_setenvif.c>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
</IfModule>
Last updated
Was this helpful?