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
3
votes
0 answers

Unable to compress response with AJAX requests

My web application is sending an AJAX request to our server using jQuery, responding in possibly large textual data. I'm using Apache and would like this data to be compressed during the transport with mod_deflate. While mod_deflate is configured on…
yby
  • 915
  • 1
  • 8
  • 24
3
votes
0 answers

mod_deflate not works on Apache 2.4.37

I've installed Apache 2.4.37 via ppa:ondrej/apache2 and can't make mod_deflate (gzip compression) works. I'm running on Ubuntu 18.04 server. mod_deflate is enabled in Apache: sudo apachectl -t -D DUMP_MODULES | grep deflate deflate_module…
Jan Hana
  • 33
  • 2
3
votes
1 answer

How to set minimum filesize for mod_deflate?

Is there a way in .htaccess to specify a minimum file size that mod_deflate should compress? For example, say I don't want anything below 1K to be compressed. Suggestions? Thanks.
StackOverflowNewbie
  • 39,403
  • 111
  • 277
  • 441
3
votes
2 answers

Reliably test if a server gzips content

I seem to be getting different results in testing whether the content is served gzipped via Apache's mod_deflate. I test the same URL and on one PC I have Content-Encoding:gzip present in response headers, on a different PC that has almost identical…
skip405
  • 6,119
  • 2
  • 25
  • 28
3
votes
6 answers

How do I enable mod_deflate for PHP files?

I have a Liquid Web VPS account, I've made sure that mod_deflate is installed and running/active. I used to gzip my css and js files via PHP, as well as my PHP files themselves... However, I'm now trying to do this via mod_deflate, and it seems to…
DM.
  • 111
  • 1
  • 1
  • 8
3
votes
1 answer

Getting mod_deflate working on Apache for a PHP app on Heroku's Cedar stack

How can I get mod_deflate on Apache and Heroku Cedar with a PHP app? I have mod_deflate importing and rules set set in my htaccess, yet my responses won't gzip.
David Sawyer
  • 558
  • 1
  • 4
  • 18
3
votes
1 answer

Blackberry reading mod_deflate compressed page

I am using Apache mod_deflate to return compressed html from a webpage. It has reduced the generated page size from 3k down to 700 bytes. How do I use HttpConnection in Blackberry to get the compressed page (i.e. only 700bytes instead of 3k)? P.S. …
nattyP
  • 309
  • 1
  • 2
  • 10
2
votes
1 answer

mod_deflate in Apache 2 produces?

What is the compression mechanism that mod_deflate in Apache2. Is it gzip or zlib or something else?
bushman
2
votes
1 answer

Does Apache Gzip remove whitespace in HTML documents?

I need to minify my PHP's output in production and from this question it sounds like Gzip is supposed to do the same, with no change in the PHP code. This would be ideal, but I'm using mod_deflate and I still get the full whitespaces; I was under…
Ben Brocka
  • 2,006
  • 4
  • 34
  • 53
2
votes
1 answer

How to enable Content-MD5 tag in Apache 2.4

I just installed a sole Apache 2.4 (without any other modules like Php or what else) and intended to host static files on it. The static files are placed under /var/www/html/test-files/. I tried to enable the core ContentDigest (documented by…
duong_dajgja
  • 4,196
  • 1
  • 38
  • 65
2
votes
0 answers

Slow site response using mod_deflate in htaccess - but why?

My site has been moved to a new server recently, and now it's having some serious issues with response time. I have to wait 4+ seconds for the site to begin loading when navigating to the homepage. I traced it down to mod_deflate. If I disable…
Farkas
  • 29
  • 5
2
votes
1 answer

Enabling mod_deflate in Apache 2.4

My old server is running Apache 2.2. It has mod_deflate enabled. It was a pretty easy setup, you just un-comment the LoadModule line, and then add the following: AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript…
l008com
  • 1,699
  • 2
  • 11
  • 20
2
votes
0 answers

How in .htaccess enable gzip only for certain url of the site?

I have the site on yii2. I am using pretty URL. And now I have the following settings for compressing: SetOutputFilter DEFLATE SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary SetEnvIfNoCase Request_URI…
2
votes
1 answer

.htaccess mod_deflate doesn't work with js?ver and css?ver

I've checked several threads and googled for a solution. But I can't get js?ver=X and css?ver=X compressed. Also for some odd reason .svgs from a certain folder show up aswell, while .svgs from other folders are being compressed. Here's my…
2
votes
2 answers

Using Gzip/Deflate with Codeigniter for better performance

I'm using Codeigniter a PHP framework and apache2. I have enabled Gzip and deflate mod in apache2 and its showing phpinfo(). When I run Yslow it shows "Grade F on Compress components with gzip". Even I changed the config.php of…
Mukesh Yadav
  • 2,256
  • 2
  • 33
  • 51
1 2
3
11 12