Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Faster heroku pushes

We are using heroku with rails, and the pushes take close to 2 minutes total.

I assume most of the time is spent in compiling slug, assets precompilation and bundle install.

Any tips on how to make this faster?

like image 571
Alagu Avatar asked Jan 28 '26 08:01

Alagu


2 Answers

Remove all unused .coffe and .scss assets.

Even an empty file can add 10/20ms to asset precompile time. Also, prefer sprockets' //=require over sass' @import, it's much faster.

like image 52
kitopastorino Avatar answered Jan 29 '26 22:01

kitopastorino


To cut down on bundle time, run the following locally after updating your bundle:

bundle package

Or, to also include gems that obtained from git sources as well:

bundle package --all

Then, commit your vendor/cache directory to your repo. When you deploy, this will cause Heroku to use the gems from your vendor/cache directory as opposed to downloading all of your gems from your Gemfile.

It will save a little time, and every little bit helps when trying to make deploys faster.

like image 29
Coeus Avatar answered Jan 29 '26 22:01

Coeus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!