Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 4: how to compile only changed assets?

For Rails 3, this question and turbo-sprockets-rails3 look great.

For Rails 4, there seems to be some controversy over whether this has been fixed or not.

I'm currently using Rails 4 in production, and it seems that because Capistrano deploy:assets:update_asset_mtimes touches all assets, deploy:assets:precompile likewise re-compiles all of them. That recompilation is the single longest step in my cap deploy.

Ideally, this should be replaced by some checksum based manifest system, so that only those assets that have actually changed (or are dependent on ones that have changed) are re-compiled.

What is the best way to do this? (Assuming we're still doing it on the server, not the dev machine.)

like image 579
Sai Avatar asked Oct 05 '13 20:10

Sai


Video Answer


1 Answers

Here is a great blog post from the guys at codeclimate about this. I've taken a look at it but not gone through the steps in production.

http://blog.codeclimate.com/blog/2013/10/02/high-speed-rails-deploys-with-git/

like image 178
ezis Avatar answered Sep 20 '22 01:09

ezis