Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable mod_deflate in apache2?

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?
like image 605
wakandan Avatar asked Dec 17 '09 16:12

wakandan


People also ask

What is Apache mod_deflate?

mod_deflate is an optional module for the Apache HTTP Server, Apache v2. 0 and later. It is based on Deflate lossless data compression algorithm that uses a combination of the LZ77 algorithm and Huffman coding.

How do I disable GZIP?

To disable gzip compression, open the corresponding file in a text editor and change gzip on to gzip off . Save the changes and close the file.


2 Answers

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>
like image 67
Gumbo Avatar answered Sep 23 '22 08:09

Gumbo


Quote from: scottlinux.com

Disable Compression: To disable compression in Apache, typically you just need to disable the module mod_deflate...

Debian/Ubuntu:

$ sudo a2dismod deflate
Module deflate disabled.
Run '/etc/init.d/apache2 restart' to activate new configuration!

$ sudo /etc/init.d/apache2 restart
like image 32
ATM007 Avatar answered Sep 19 '22 08:09

ATM007