Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

You'll want to look into mod_deflate (http://httpd.apache.org/docs/2.2/mod/mod_deflate.html)

Depending on the operating system, but on most Linux-based systems you can do the following:

  1. edit the configuration file httpd.conf or similar)
  2. if you have a VirtualHost container, add this: SetOutputFilter DEFLATE
  3. you can also set directory-specific compression:

    <Directory "/path/to/website">

    AddOutputFilterByType DEFLATE text/html

    </Directory>

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.

share|improve this answer
add comment

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.

share|improve this answer
    
I tried the .htaccess entry but it dint work :( –  Gourav Jude Mar 11 '13 at 11:30
1  
Too bad because it works for me. –  Zistoloen Mar 11 '13 at 12:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.