How to cache Yarn/Node packages on the App Platform

I have a Rails/Yarn app that I’m trying out on the App Platform, which is working fine - both the nodejs and ruby buildpacks run:

4 of 5 buildpacks participating
heroku/nodejs-engine        0.5.1
heroku/ruby                 0.230.3
digitalocean/ruby-appdetect 0.0.2
digitalocean/procfile       0.0.3

Bundler appears to cache the ruby gems, which is excellent, as the install times (for everything except the first deploy) are very quick. I see:

-----> Loading Bundler Cache

and then all the gems install in a matter of seconds.

However, the same doesn’t appear to happen for Yarn/Node - there’s no equivalent “loading cache” line for Yarn, and I infer all the modules install from scratch, as they take some time on every deploy:

[5/5] Building fresh packages...
Done in 385.20s.

Is there a way I can cache the Yarn packages for faster deploys? (I’m also a little confused as to the App Platform/Heroku Buildpacks relationship - what elements of the Heroku Buildpacks apply here - is that the documentation I should be reading to try to find these kind of answers?)

Many thanks!

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer