[BlueOnyx:04317] Re: Turn Gzip Compression On

Michael Aronoff maronoff at gmail.com
Mon Apr 19 11:10:48 -05 2010


On Mon, 2010-04-19 at 17:17 +0200, Steffan wrote:
> Hello list
> 
> Does anybody know i fit is possible to include Mod_deflate serverwide ?

I have used the following for a long time on both BQ and BX machines.

Create a new file such as /etc/httpd/conf.d/moddeflate.conf
This will ensure that the change is not overwritten later.
The contents of that file should be:

### Addons - Enable Mod Deflate - Start ###
# SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/x-js
text/css application/x-javascript
DeflateCompressionLevel 8
DeflateMemLevel 8
DeflateWindowSize 14
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|exe|t?gz|zip|bz2?|rar)$
no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent env=!dont-vary
### Addons - Enable Mod Deflate - End ###

That is all. Save the file and then restart httpd service. The commands in
that file will compress Text(HTML), XML, CSS and javascript while explicitly
NOT compressing images of PDF's (compression can mess some of those up). It
also looks for older browsers and will not compress on old browsers that do
not support it.

You can also go to http://www.gidnetwork.com/tools/gzip-test.php to test and
see that it is working. 

I hope that helps.

Michael Aronoff Out




More information about the Blueonyx mailing list