Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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. domain.com.conf has this lines to enable the compression - http://pastebin.com/LV6Tyv38

Now, I created domain1.com.conf without inculding compression line stated on the link and I expect gzip compression is disabled only for domain1.com. 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.

Thanks.

JamesW

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
add comment

1 Answer

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
4  
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
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.