Enabling Compression on a Apache (Hostmonster) Joomla Website

Enabling Compression on a Apache (Hostmonster) Joomla Website

Edit php.ini so that the following lines read as follws (you only need ot change the first one on a Hostmonster site):

{code lang:ini showtitle:false lines:false hidden:false}output_handler = ob_gzhandler
zlib.output_compression = Off
;zlib.output_compression_level = -1{/code}

Add the following to the htaccess:

{code lang:ini showtitle:false lines:false hidden:false}
<IfModule mod.gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(js|css|html|php)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*

AddEncoding gzip .gz

<Files *.css.gz>
ForceType text/css
Header set Content-Encoding: gzip

<Files *.js.gz>
ForceType text/javascript
Header set Content-Encoding: gzip

Confirm compression is working using the following website: http://www.gidnetwork.com/tools/gzip-test.php