I want to enable gzip compression for acethehimalaya.com. Can anybody please tell me what is the best way of achieving compression in an Apache Webserver?
You'll want to look into
Depending on the operating system, but on most Linux-based systems you can do the following:
- edit the configuration file httpd.conf or similar)
- if you have a
VirtualHostcontainer, add this:
you can also set directory-specific compression:
AddOutputFilterByType DEFLATE text/html
On the other hand, and probably a more efficient thing, is to use Google's
mod_pagespeed (link). In summary, install one of the binaries on the right-side of the page. This will automatically perform updates for you when you run updates on the [server?]. You can compile it yourself as well.
The benefits of
mod_pagespeed are that it compresses AND caches your content for you. Thereby reducing CPU usage and bandwidth.
The easiest way to manage Gzip compression in Apache is to add these lines in your .htaccess file:
<IfModule mod_deflate.c> <FilesMatch "\.(html|php|txt|xml|js|css)$"> SetOutputFilter DEFLATE </FilesMatch> </IfModule>
It works well for my website.