How to disable mod_deflate in apache2?

wakandan picture wakandan · Dec 17, 2009 · Viewed 24.5k times · Source

How can I disable mod_deflate in Apache2

  • For files in a specific directory

OR

  • For all files that have extension of, for example .py?

Answer

Gumbo picture Gumbo · Dec 17, 2009

You could set the environment variable no-gzip for that directory/type of file:

# for URL paths that begin with "/foo/bar/"
SetEnvIf Request_URI ^/foo/bar/ no-gzip=1

# for files that end with ".py"
<FilesMatch \.py$>
    SetEnv no-gzip 1
</FilesMatch>