Wednesday, August 6, 2008

Enable gzip compression on Apache web server in 3 easy steps

Make the following changes in apache/conf/httpd.conf :-

1) Uncomment "LoadModule deflate_module modules/mod_deflate.so"

2) Add "SetOutputFilter DEFLATE" inside <<IfModule mime_module> section

3) Add "AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css" right after SetOutputFilter... line.

Restart Apache. You should see a significant improvement in the turnaround time for your web applications. This setting works for all responses tunneled trough Apache for ex:- for java web applications deployed on a Tomcat integrated with apache web server etc.

No comments: