Heroku rails 3.1 app - compiling assets locally vs compiling assets during slug compilation Heroku rails 3.1 app - compiling assets locally vs compiling assets during slug compilation heroku heroku

Heroku rails 3.1 app - compiling assets locally vs compiling assets during slug compilation


I addressed some of these issues and a big gotcha in my question here: Rails 3.1.1 asset pipeline Heroku caching gotcha

I'd prefer #2 if it worked for me so I don't have to checkin compiled assets which just bloats the git repository.

Compiling assets during slug compilation won't result in any additional downtime because your existing app will stay up until slug compilation is complete so no worries there.

My advice would be #2 if you can make it work for you. If you do end up going w/ #1 then take best practice would be to git rm -r public/assets before rake assets:precompile to make sure no cruft remains.


It could depend on the size of your asset folder, (and maybe a long term solution would be to put those assets outside the application and host them on S3 or the like.)

Otherwise, I am supposing #1 would be the best on production since any asset can be used and cached straight away.

I am reading Heroku's documentation section on assets, and they seem to indicate that #2 would be used just in case you have forgotten to do it yourself, as a convenience. You will not get a small slug, since the results of asset preparation will be included in the slug to deploy itself.