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.

We used this PHP code to disable gzip compression for specific scripts

@apache_setenv('no-gzip', 1);

But our admin migrated to FastCGI and this does not work anymore. How to do it?

Thanks

share|improve this question
add comment

1 Answer 1

Off the top of my head I don't recall the specific rules to apply but it's likely that your answer is using a rewrite rule in htaccess to set the environment for Apache whenever certain scripts are accessed that you don't want gzip compression used on.

I believe it's something like:

<Location />
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI ^/your-non-gizp.php$ no-gzip
</Location>

The only times this wouldn't be the best choice is if you don't know which scripts ahead of time that need to be set to not have their output compressed or if you need to set it on/off based on dynamic logic within the script.

There's another way to do it which would keep FastCGI from caching the output but that would defeat the purpose. The htaccess method is probably best.

share|improve this answer
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.