Speed up Apche2 with mod_deflate

Before there was mod_gzip but now in Apache 2 there is mod_deflate. Its pretty much the same, and included with the default source package now. The syntax is pretty much the same. You can set it across the board or on a MIME type basis.

Check out the Apache docs for a proper understanding. Currently I am still testing my setup and on my Ubuntu installation I edited the following configuration to add some MIME Type rules

view plain print about
1$ sudo nano etc/apache2/mods-enabled/deflate.conf

The following rules I am using are

view plain print about
1<Location />
2AddOutputFilterByType DEFLATE text/plain
3AddOutputFilterByType DEFLATE text/xml
4AddOutputFilterByType DEFLATE application/xhtml+xml
5AddOutputFilterByType DEFLATE text/css
6AddOutputFilterByType DEFLATE application/xml
7AddOutputFilterByType DEFLATE application/rss+xml
8AddOutputFilterByType DEFLATE application/atom_xml
9AddOutputFilterByType DEFLATE application/x-javascript
10AddOutputFilterByType DEFLATE text/html
11<Location>

Do read the docs though, as not all browsers can handle this but there are ways to get around that.

Posted: 23-Apr-2009

View: 1908

Permalink: here

Comments