First of all, according to this answer, the :cache => true
option on stylesheet_link_tag
and javascript_include_tag
doesn\'t work o
Here are the config options to compress your assets.
http://guides.rubyonrails.org/asset_pipeline.html#customizing-the-pipeline
config.assets.css_compressor = :yui
config.assets.js_compressor = :uglifier
config.assets.compress = true
gem 'uglifier'
gem 'yui-compressor'
There are probably various ways to do this, but what works for me is to minify before pushing. Then I use a subtree to keep my build files separate from the "source" files. So, for example, if you build to a folder called "dist", you can push to a subtree called heroku/master like this:
git subtree push --prefix dist heroku master
Just don't forget to ensure that the dist folder is not ignored (it often is, by default) - so edit your .gitignore file accordingly.
The --prefix command ensures that the dist folder effectively becomes the "root" folder from the point of view of that branch.