Make sure the deflate module is enabled:

sudo a2enmod deflate

then add the following to your vhoste 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

Then restart apache with sudo /etc/init.d/apache restart. After that, if you look up the response headers you should see that the content-encoding is gzip. That's it ! Happy saving !