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
1
vote
1 answer

Why does the file size matter for apache command Header append Vary User-Agent to trigger?

I'm using symfony 3, and have the following .htaccess file (attached to the very bottom of this message noted as 'problem .htaccess'). I'm using the website gtmetrix.com (which uses pagespeed) to optimize my site, but I'm getting the following…
Joseph Astrahan
  • 8,659
  • 12
  • 83
  • 154
1
vote
1 answer

Not able to enable mod_deflate on Apache / CentOS7

I followed a simple tutorial from a good source, and gzip compression does not work. 1) I run the following to see whether mod_deflate is already installed: apachectl -t -D DUMP_MODULES | grep deflate I got deflate_module (shared), so it was…
Tom Smith
  • 125
  • 1
  • 1
  • 5
1
vote
0 answers

Can you exclude a URL from mod_deflate gzip rules?

I have added the following code in my .htaccess file: AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript However, I have one URL…
LBF
  • 1,133
  • 2
  • 14
  • 39
1
vote
0 answers

Cache disabled after enabling compression with mod deflate on apache

i have added this code to .htaccess for auto comperssion of css,js,html and images. # Compress HTML, CSS, JavaScript, Text, XML and fonts AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType…
1
vote
0 answers

If I use mod_deflate, will stripping whitespace in my outputted HTML files also help increase speed?

I am already using HTACCESS through Apache to GZIP the contents of all HTML, CSS and JS files that are served. I use a program called Koala that automatically minifies JS and CSS output to have zero whitespace, but since I am using PHP to…
connergdavis
  • 303
  • 4
  • 11
1
vote
1 answer

How to enable mod_deflate and mod_pagespeed on a php heroku app on the cedar stack?

I am lost in trying to figure out how to enable mod_deflate and mod_pagespeed on my php app hosted on heroics' cedar stack. I can't find anything about doing so online and what I have found is either outdated or unhelpful. Thank you!
brandonmhp
  • 41
  • 5
1
vote
1 answer

How to compress html pages using SetOutputFilter DEFLATE

I am not able to get compressed html pages in my browser even though I am 100% sure mod_deflate is activated on my server. My htaccess file has this code snippet : SetOutputFilter DEFLATE …
Vincent
  • 1,651
  • 9
  • 28
  • 54
1
vote
1 answer

Apache 2.4 gzip compression not work on JS but work on CSS

Apache 2.4 with mod_deflate compress CSS but not JS .htaccess # Proper MIME types for all files AddType application/javascript js AddType text/css css
ar099968
  • 6,963
  • 12
  • 64
  • 127
1
vote
1 answer

.htaccess rules working for some pages, but not for others

I'm trying to use Google PageSpeed Insights to speed up my website - www.edmhunters.com. First off, here is what my .htaccess file looks like # ----------------------------------------------------------------------- # Caching for 1 Year #…
Yin Yang
  • 1,776
  • 3
  • 26
  • 48
1
vote
1 answer

Compressing js & css files where mod deflate not available

I'm using a shared 1and1 package for a Magento website and it seems I can't use the standard approach of compressing css and js files via htaccess. I came across this http://mrrena.blogspot.co.uk/2009/01/how-to-compress-php-and-other-text.html which…
PedroKTFC
  • 745
  • 10
  • 28
1
vote
1 answer

Apache 2.4.7 isn't sending 304 response when mod_deflate is enabled

I'm running Apache 2.4.7 on Ubuntu Server 14.04 I have a webserver running. It returns 304 modified for images, but it doesn't return the same for json files. I have checked the answers and comments for this post and this post, however, they don't…
wiseindy
  • 19,434
  • 5
  • 27
  • 38
1
vote
1 answer

Do an HTTP Post in .NET (Vb) with compressed data using deflatestream

The data that I am posting from a VB.Net client is large and I want to compress. I want to do a "POST" and the apache server supports mod_deflate. I am trying to integrate DeflateStream into my post code, however does not seem to be working. I can…
Brian
  • 433
  • 1
  • 7
  • 16
1
vote
1 answer

gzipping my site doesn't seem to work using htaccess - no Content-Encoding: gzip

I'm trying to gzip my site. But I'm not sure if it's actually working.. When I'm checking at checkgzipcompression.com, WhatsMyIP.org and YSlow - they all tell me that the site is not compressed. Yslow also tells me that I have a couple of files that…
ThomasK
  • 2,210
  • 3
  • 26
  • 35
1
vote
1 answer

Filtering Out Browsers Without GZIP Support with mod_deflate

I am using mod_defalte, as so: AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE image/svg+xml …
Kohjah Breese
  • 4,008
  • 6
  • 32
  • 48
1
vote
1 answer

php error compression mod_deflate gzip compression

I follow this way compression 1 and compression 2 how to compression with mod_deflate? I've followed the above link and success to compress but browser can not read compression? I get an error when I open the css and js files in a…
Ardy Ant
  • 59
  • 1
  • 10