Mod deflate Guide

From The Wiki Guide

Jump to: navigation, search
Apache Logo


Contents

Abstract

The mod_deflate module provides the DEFLATE output filter that allows output from your server to be compressed before being sent to the client over the network. This module is beneficial on web servers hosted on broadband connections (DSL, Cable). Since this modules compresses data, cpu load will be higher depending on traffic.

Requirements

Apache Web Server 2.x or higher

Configuration

In your httpd.conf file add the following:

#mod_deflate
LoadModule deflate_module modules/mod_deflate.so
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \
   \.(?:exe|t?gz|zip|bz2|sit|rar)$ \
   no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
DeflateFilterNote Input input_info DeflateFilterNote Output output_info DeflateFilterNote Ratio ratio_info LogFormat '"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)' deflate CustomLog /var/log/httpd/deflate_log deflate BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/htm

References

Apache Web Site
Apache mod_deflate Documentation

Personal tools