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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With