0

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

Josef Sábl
  • 111
  • 1
  • 4

1 Answers1

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.

Jay
  • 106
  • 3