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

.htaccess - Set expire headers while url rewriting

I'm rewriting using htaccess like: # ENABLE REWRITE Options +FollowSymLinks -MultiViews RewriteEngine On RewriteRule ^gallery/(.+)$ /image.php?image=$1 [L,QSA,NC] # EXPIRES CACHING ExpiresActive On ExpiresByType image/jpg…
RhymeGuy
  • 2,102
  • 5
  • 32
  • 62
1
vote
1 answer

Howto disable mod_deflate compression from within a mod_perl script

I'm developing a web application running on Apache that is generating content in Perl scripts (mod_perl) and the output is being compressed with mod_deflate. This works pretty well, but sometimes during the content generation the script notices that…
Gene Vincent
  • 5,237
  • 9
  • 50
  • 86
1
vote
2 answers

mod_deflate not compressing js in wordpress site

I'm working on a wordpress site. I enabled mod_deflate with this command in .htaccess: AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript but if i test with GTMetrix:…
mascor
  • 25
  • 2
  • 8
1
vote
1 answer

Decompress gzipped http response inside Vim

For debugging purposes I sniffed some requests and responses from my server/client. The compression is enabled so the responses are sent in gzip format. I know that probably I could just disable mod_deflate, but... out of curiosity, is there a way…
franzlorenzon
  • 5,845
  • 6
  • 36
  • 58
1
vote
0 answers

Responding to google page speed suggestion regarding compression

Google page speed tool tells me this: "Compressing resources with gzip or deflate can reduce the number of bytes sent over the network" and of course lists all my .js and .css files. Researching here eventually led me to this question: How to…
C C
  • 419
  • 1
  • 4
  • 18
1
vote
1 answer

.htaccess rule for compressing files with custom extension

I have the following .htaccess file copied directly from html5boilerplate.com: # Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
Nikola
  • 14,888
  • 21
  • 101
  • 165
1
vote
2 answers

Why Apache doesn't gzip css or js files which have parameters?

Some CSS & JS files are not compressed by apache with mod_deflate enabled. This files looks like this "[domain.name]/aggregator.css?..." or "[domain.name]/misc/jquery.js?..." in YSlow. The other CSS & JS without the "?" gets compressed. Kindly…
0xFaCeB00c
  • 107
  • 1
  • 3
  • 8
1
vote
1 answer

HTTP Header Content-Length not work

I wish to display the size of the file to the client when they download it. But HTTP Header Content-Length not work. My Environment is follow. Apache 2.2 mod_deflate Rails3.2 A download file is in the rails project public folder. Response Header…
Yuri
  • 57
  • 1
  • 7
1
vote
1 answer

HTTP Compression Not 100% on Apache (at Dreamhost)

I am trying to get gzip compression working on the site lavenderdiamond.net/home. I've added the following code to my .htaccess but none of the files that are served on my site are being compressed. I've also checked to see if mod_deflate is enabled…
fraxture
  • 5,113
  • 4
  • 43
  • 83
1
vote
1 answer

gzipped Apache response packet analysis

After enabling gzip compression in my Apache server (mod_deflate) I found consistently that end user was being served on average 200 ms slower than uncompressed responses. This was unexpected so I modified the compression directive to ONLY compress…
bushman
  • 92
  • 8
1
vote
2 answers

How to disable mod_deflate for php using .htaccess file?

How to disable mod_deflate for PHP using the.htaccess file for files in a specific directory for all files that have extension of, for example .php? I have tried both: # for URL paths that begin with "/foo/bar/" SetEnvIf Request_URI ^/foo/bar/…
Brian Royce
  • 11
  • 1
  • 3
1
vote
1 answer

Apache deflate on files match condition

I am trying to deflate files based on the FilesMatch condition, I tried this but it doesn't deflate : SetOutputFilter Deflate RewriteEngine on RewriteRule /js/(.*.js) /pack.php?f=$1 The rewrite rule works fine…
karth
  • 635
  • 3
  • 13
  • 25
0
votes
1 answer

videos not playing in Flowplayer after configuring mod deflate

I configured Apache/2.2.17 server on Windows 7 with mod deflate configured in .htaccess as SetOutputFilter DEFLATE SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ \ no-gzip dont-vary SetEnvIfNoCase Request_URI \ \.(?:exe|t?gz|zip|bz2|sit|rar)$…
Ajeet Sinha
  • 2,315
  • 20
  • 20
0
votes
1 answer

Apache 2.x mod_deflate compression only working on OSX

Apache2 successfully streams pre-compressed content on my Mac's installation. I can use files like index.gz, textfile.gz, etc and they all load fine in a browser. But when I try to create the same configuration on other Apache environments like…
mmond
  • 3,553
  • 2
  • 13
  • 7
0
votes
3 answers

Gzip on merged CSS/JS files in Magento

I'm trying to speed up my Magento store and have recently enabled Gzip compression. The problem is, i also use the Magento in-built function that merges all CSS and JS files together to serve a single file for each. The Gzip does not compress those…
Teekay
  • 163
  • 3
  • 10