The answer to your question can be found at https://gist.github.com/2152663.
Use this gem github.com/mattolson/heroku_rails_deflate
gem github.com/mattolson/heroku_rails_deflate