Config Apache HTTP Server to Compress JavaScript
Author
Zhou Renjian
Create@
2007-03-05 22:04

Simply add the following lines to httpd.conf.
AddOutputFilterByType DEFLATE text/css text/javascript application/x-javascript
or with if condition:
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/css text/javascript application/x-javascript
</IfModule>
or with logs:
AddOutputFilterByType DEFLATE text/css text/javascript application/x-javascript
DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '%v %h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i" mod_deflate: In:%{instream}n Out:%{outstream}n:%{ratio}npct.' deflate
CustomLog logs/deflate_log deflate
For more details, please read http://www.clarkconnect.com/wiki/index.php?title=Howtos_-_Activating_content_compression_on_Apache