views:

37

answers:

1

What is the recommended way to configure Apache to enable HTTP compression for CSS and JS fiels, using .htaccess? I have seen several different directives used in examples on the web. I have tried some of these and yet I have not been able to get it to work. I am checking the HTTP headers using Firebug.

A: 

Ensure that mod_deflate and mod_mime are enabled and add something like:

AddOutputFilterByType DEFLATE application/x-javascript text/javascript text/css

to your .htaccess.

See also: http://brightscape.net/blog/compress-your-web-pages-with-mod_deflate/

Daniel Trebbien