Mod Deflate is essential nowadays for sites, it speeds up the transfer of html pages & other files (such as stylesheets) by compressing them first. Now that servers today are so powerful there is very little reason not to use this, especailly since so many “speed up” tests will not pass without this being enabled.

However whilst you can enable it site-by-site, however for shared hosts with many sites this is not the best way, but you can enable it globally.

  1. First ensure it’s installed, you can do this by using EasyApache and ensuring that mod_deflate is selected (it may be already),once apache has been compiled deflate is now enabled.
  2. If you want to enable the functionality site-by-site then in each sites control panel a new option is now available.  under Software/Services the user can now choose to optimise their website, this essentially allows deflate to be turned on and off.
  3. If you want to do this globally (why not it cuts bandwidth and keeps your users happier) then  simply follow the following:
  • Under Services Configuration / Apache Configuration / Include Editor / Post Virtual Include
  • Select All Versions (no point in not doing all versions)
  • Paste the following into the file and then click Update.
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
<IfModule mod_setenvif.c>
# Don’t compress images its a bit pointless
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
</IfModule>
<IfModule mod_headers.c>
# Make sure proxies don’t deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>
#maximum compression - why not we have spare cpu
DeflateCompressionLevel 9
</IfModule>