Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im using Apache and I have enabled zip compression to all my virtual host domain. However, I want to disable the gzip compression on one particular virtual host only. I try this method.

All separated virtual host file i.e. has this lines to enable the compression -

Now, I created without inculding compression line stated on the link and I expect gzip compression is disabled only for BUT, when I checked the HTTP header, I can still get these outcome.

Content-Encoding: gzip
Vary: Accept-Encoding

I would appreciate if anyone could help me to shed some lights on how to properly disabled zip compression for a particular virtual host in apache.



share|improve this question
I tried to add this lines to .htaccess but the outcome is still the same. "SetEnv no-gzip dont-vary" – James W. Oct 8 '12 at 6:03

There really shouldn't be any reason to disable it, but..

SetEnv no-gzip 1
share|improve this answer
@ShaneMadded it doesn't work. It's still there. – James W. Oct 8 '12 at 6:02
Ok, let's try the sledgehammer approach, then: RequestHeader unset Accept-Encoding – Shane Madden Oct 8 '12 at 6:04
it's gone. Thanks! How can I check correctly if the gzip compression is really disabled? – James W. Oct 8 '12 at 6:08
When I use "Developer Tools" of Google chrome, I still can see this header -- "Accept-Encoding:gzip,deflate,sdch"... But on normal header checker like online tool or addons of the browser for http header, it doesn't appear those line. – James W. Oct 8 '12 at 6:21
Your client's not being prevented from sending the header (so you're still seeing that request header being sent), we're just having the Apache server discard it (so that it thinks the client doesn't support compression at all) before mod_deflate gets a chance to do compression. The fact that the Content-Encoding is no longer gzip means that it's working. – Shane Madden Oct 8 '12 at 18:58

Your Answer


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.