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

Apache: How to decompress pre-compressed HTML using mod_deflate? (INFLATE not working as documented)

I am working on a statically generated html site, that is bundled into a container image. To reduce the overall size of the container image, we pre-compress all HTML files, and to simplify our Apache config we remove the '.gz' part of the file…
Jared Sprague
  • 229
  • 4
  • 12
0
votes
0 answers

gzip and deflate in .htaccess

Is it possible to use both gzip and deflate or do we have to only use one of them in .htaccess eg ... ... .. I saw a previous question that explains the difference but I am…
Mr Pro Pop
  • 666
  • 5
  • 19
0
votes
1 answer

Is it possible to DEFLATE a .woff2 file in .htaccess in nginx?

I have the following in my global .htaccess file on my nginx server: # COMPRESS FILES [...] AddOutputFilterByType DEFLATE application/font-woff2 AddOutputFilterByType DEFLATE font/woff2 [...] I…
Rounin
  • 27,134
  • 9
  • 83
  • 108
0
votes
1 answer

Can mod_deflate compress the output depending on the "Host" header in the Request Headers?

Can mod_deflate compress the output depending on the "Host" header in the Request Headers? As far as I understand based on the documentation, it is usually done by looking at the User-Agent etc. in the configuration. I could not find any example in…
user855
  • 19,048
  • 38
  • 98
  • 162
0
votes
2 answers

Drupal - Apache's Mod_Deflate breaks CSS

We have enabled Apache's mod_deflate on our drupal site. From that point onwards, we are noticing that CSS files aren't getting loaded properly. It doesn't happen every time. Kinda random. Did anyone else notice this issue? If so, any suggested…
Think floyd
0
votes
1 answer

Apache mod_deflate doesn't compress although logfile says it would

I tried googling this by hard but was unsuccessful so far. I've got an apache 2.2.16 on Debian with mod_deflate loaded and enabled like this: LoadModule deflate_module /usr/lib/apache2/modules/mod_deflate.so and AddOutputFilterByType DEFLATE…
Marc82ch
  • 3
  • 2
0
votes
2 answers

GZIP only compresses files when full file path specified - won't compress root

If I include the following in my .htaccess, GZIP will only compress files when the full path to the file is specified: RewriteRule ^ index.php [L] But the above rewrite is necessary to allow my CMS to function. So for…
ColossalYouth
  • 456
  • 3
  • 11
0
votes
1 answer

mod_deflate - can't seem to get content-encoding header to be set

I am trying to set up mod_deflate to deliver compressed css/js/html content, but am having difficulty getting apache to send the 'content-encoding' header correctly. I have tried the following, placed in my .htaccess file in the web…
0
votes
0 answers

Apache2.4 gzip compression on Solaris 11

I have created Angular App for which I am facing performance issues as my main.js file size is 3.76 MB. So I looked for enabling gzip compression on server. It worked for Apache in windows but not for Solaris 11. So is there a different way to…
Rohit
  • 179
  • 3
  • 12
0
votes
1 answer

Not able to activate text compression on apache 2.4 server

i search many postings about activating compression an apache 2.4.10 servers. Non of the solutions are working for me. I have no more ideas. I activated all neccessary modules (here printout of apachectl -M): Loaded Modules: access_compat_module…
Gunnar Gläser
  • 337
  • 5
  • 13
0
votes
1 answer

Problem with mod_deflate - compressing executable file

When trying to download file with.EXE extension in the site, the files are coming as .GZ Environment Centos 7 64 Apache 2.4.6 Changing the file in /etc/httpd/conf/httpd.conf I have already tried using each of these forms below, however, to no avail…
Mylon
  • 115
  • 1
  • 2
  • 8
0
votes
1 answer

Apache Deflate on CSS and JS in subdirectory - No Compression

Website: http://taylorsbackyardcenter.ca/store So I'm finishing an OSCommerce site and I'm implementing compression, caching, and site optimization. I have run into a problem with deflate. Both Page Speed and YSlow inform me that: Compressing…
taylorjes
  • 434
  • 3
  • 18
0
votes
1 answer

htaccess mod_deflate and mod_include with JS files

i using mod_deflate to compress my (html|css|js|xml|php|txt) Files. (working without any problems) I also combine my CSS / JS Scripts with the mod_include module to save requests... Both working well...but they are uncompressed. With my combined CSS…
Tom
  • 151
  • 10
0
votes
1 answer

mod_deflate not working on all subdirectories

I'm trying to optimize a site for speed and I've enabled mod_deflate inside the htaccess file with the following snippet. # Compress HTML, CSS, JavaScript, Text, XML and fonts AddOutputFilterByType DEFLATE…
joeb
  • 777
  • 8
  • 28
0
votes
1 answer

Can't get passed render blocking css/js issue with Page Speed Insights

I am trying to optimize my website to be as fast as possible. On Google Page Speed Insights, I have been going through the recommendations, and have gotten a lot done. One thing I can't seem to get passed is the render blocking css/js issue. I have…
TJB
  • 3,706
  • 9
  • 51
  • 102