Questions tagged [mod-deflate]

The mod_deflate is an Apache web server module that provides the DEFLATE output filter that allows output from your server to be compressed before being sent to the client over the network.

The mod_deflate is an Apache web server module that provides the DEFLATE output filter that allows output from your server to be compressed before being sent to the client over the network.

Simplest configuration is made by putting the following line in the .htaccess file:

AddOutputFilterByType DEFLATE text/html text/plain text/xml

The following configuration, while resulting in more compressed content, is also much more complicated. Do not use this unless you fully understand all the configuration details. Compress everything except images:

<Location />
    # Insert filter
    SetOutputFilter DEFLATE

    # Netscape 4.x has some problems...
    BrowserMatch ^Mozilla/4 gzip-only-text/html

    # Netscape 4.06-4.08 have some more problems
    BrowserMatch ^Mozilla/4\.0[678] no-gzip

    # MSIE masquerades as Netscape, but it is fine
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    # Don't compress images
    SetEnvIfNoCase Request_URI \
    \.(?:gif|jpe?g|png)$ no-gzip dont-vary

    # Make sure proxies don't deliver the wrong content
    Header append Vary User-Agent env=!dont-vary
</Location>
166 questions
2
votes
1 answer

Apache 2.4.10 mod_deflate small response size not compressed

I updated apache from version 2.2 to 2.4 some time ago and now all responses are not compressed anymore by mod_deflate. The limit seems to be 68 bytes. I tried to find some setting for this but could not find anything - is it even…
drodil
  • 2,292
  • 1
  • 22
  • 37
2
votes
1 answer

gzip/mod_deflate does not work on apache2, ubuntu, amazon ec2

I have tried everything and I cannot get gzip or mod_deflate to work. I have placed almost everything into my .htaccess file as well as my apache2.conf file. They all do not work. Here is my server configuration: Amazon EC2 with everything forced to…
user13225
  • 21
  • 3
2
votes
0 answers

Using mod_deflate gzip compression with mod_expires results in no cache?

Is it possible to use mod_deflate and mod_expires at the same time? None of the assets seem to be cached and I suspect it's because the contents have changed due to mod_deflate / gzip compression. The server returns a 200 status rather than a 304.…
Bat
  • 255
  • 3
  • 12
2
votes
3 answers

How to disable compression in Apache on some response header from mod_jk proxied application server

I have a tomcat server configured (by mod_jk) to work through Apache Httpd server. Apache Httpd server compresses (by mod_deflate) all text/html sent to browser. Some jsp pages are interactive and long running, i.e. display progress or log during…
huksley
  • 127
  • 1
  • 7
2
votes
2 answers

Deflate zlib vs. Gzip compression on apache ... how to enable

I've read on a couple of blogs, notably here http://www.codinghorror.com/blog/2008/10/youre-reading-the-worlds-most-dangerous-programming-blog.html there are some advantages to using deflate zlib compression by comparisson to gzip one. I am trying…
tumika
  • 21
  • 1
  • 3
2
votes
1 answer

mod_deflate Supported Encodings for Compression

It seems to me, that mod_deflate in Apache 2.2 will always return: Content-Encoding: gzip and never: Content-Encoding: deflate It was explained to me, that although there may be a deflate algorithm, mod_deflate is named after a file-format, in which…
sparc
  • 23
  • 5
2
votes
2 answers

Apache: Caching a DEFLATE'd file

It seems redundant to have zlib compress a web page during every request. It is also the bottleneck of my files' response times. Is there a way to cache the zlib'd file so that it is compressed only once at each modification? Or should I just keep…
moo
  • 7,619
  • 9
  • 42
  • 40
2
votes
1 answer

How to flush gzipped part of html page

I'm trying to have my page output it's < head > + some body stuff, and send it to the browser. Then make some long mysql queries and output the rest of the page. This works perfectly as long as I don't gzip the content. Example: A simplified…
Richard Deurwaarder
  • 2,023
  • 1
  • 26
  • 40
2
votes
1 answer

Apache AddType directive for .js files does not work

I run YSlow in a couple of sites of mine and it reports that one .js file is not compressed. mod_deflate is enabled of course (other html and text files are compressed): AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml…
Vasilis Lourdas
  • 1,179
  • 1
  • 16
  • 35
2
votes
1 answer

Apache lags when responding to gzipped requests

For an application I'm developing, the user submits a gzipped HTTP POST request (content-encoding: GZIP) with multipart form data (content-type: multipart/form-data). I use mod_deflate as an input filter to decompress and the web request is…
UsAaR33
  • 3,536
  • 2
  • 34
  • 55
2
votes
0 answers

Manual content compression in Apache

I need a manual compression solution on Apache. My goals: Provide gzip-encoded content on my server along with uncompressed. Files are pre-compressed. Not all files are served compressed. I want to specify these files and the choice isn't type…
Tupteq
  • 2,986
  • 1
  • 21
  • 30
2
votes
1 answer

Apache mod_deflate: Curl VS everything else

I hope someone can help me with this as it's driving my crazy. I have set up mod_deflate on a server, everything SEEMS to be set up correctly, however when I access a CSS or JavaScript file via a browser it's saying the files are not…
2
votes
1 answer

How do I use mod_deflate in Apache 2.4.1 with Haproxy?

I have a strange issue whereby including the following syntax in my Apache 2.4.1 httpd.conf causes "502 Bad Gateway" errors when retrieving swf files via HAproxy: AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css…
Tom
  • 1,055
  • 2
  • 14
  • 21
1
vote
2 answers

Eaccelerator with mod_deflate or gzip

First. Which differences between mod_Deflate and gzip, which is better ? And can i use Eaccelerator + mod_deflate together.
Ronin
  • 5
  • 2
  • 7
1
vote
2 answers

mod_deflate on apache causing browser to do a 200 instead of 304?

I enabled mod_deflate on Apache 2 on an Ubuntu machine and noticed that my browser doesn't cache the compressed file types on page refreshes. I used firebug's net settings to check this and verified on another computer. Under mod_deflate if I…
Avichal