The HTTP Server Data Compression

The HTTP Server usually transfers data without compression by default. I searched in the Internet and found an article to teach me how to load and configure the compression module. (mod_deflate)

I use Debian Linux 4.0 with Apache 2.2.3 .

First, use switch user do to switch user to root (must in sudoer)

Second, enable the Aapche2 module “deflate” to compress your transfer data.

Third, config your /etc/apache2/mods-enable/deflate.conf . The DeflateCompressionLevel is from 0 to 9, accroding to the opinions from other’s blog, they said “level 6” is the best parameter with good compression rate and medium CPU usages.

Then, restart your web server, everything is done.


The testing result is calculated by Port80 Compression Check . Now, we know the deference between the data size with zip compresstion or not.

P.S. You also can configure the /etc/php5/apache2/php.ini to enable the “ob_gzhandle”, or “zlib” (must load the zlib extention), but both of them can’t compress the static html pages, js, or css files.

refer: http://twntwn.info/blog/ajer001/archives/1889, thanks for ajer’s article.

Posted in computers

Leave a Reply

Your email address will not be published.