Monorepo build cache

I have a monorepo with 2 static sites (nextjs) and 1 node app. I install the dependecies in the subfolders ( cd client && yarn ) but this takes a lot of time because the node_modules in the subfolder are remove between every build. Does the build cache only work at the root repo dir?

Currently, yes- the build cache only takes affect at the root repo. This is something we’re aware of and have an active feature request for. If you’d like, you can vote for that here (Specify additional directories to cache after build | Feature Requests | Render) and you’ll be updated when we make progress on this.

As a workaround, I believe you can use $XDG_CACHE_HOME as described a bit more in that feature request to specifically choose data to copy over and restore on builds.