Enable Gzip Compression using Htaccess

Add these lines to the .htaccess file.

AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

Or you can specifically compress certain types of files.
The following code will compress only css and javascript files.

<Files *.css>
SetOutputFilter DEFLATE
</Files>
<Files *.js>
SetOutputFilter DEFLATE
</Files>

To check whether the compression is working, use Google PageSpeed or Yahoo YSlow

A more detailed explanation is given in http://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/