Hi! We’re building a Node.js-based application on Render, and we use npm ci to install dependencies. This means that (as documented), when there’s a node_modules directory present before running npm ci, it is removed and then npm does a clean install.
So this means that Render’s cache behavior, in which it saves node_modules after a build and recovers it before the next build, is unfortunately pure overhead: we’re not using that recovered node_modules directory, which takes significant time to download from the cache.
So I want Render to not cache node_modules between builds.
However, I can’t see a clear way to disable Render’s cache behavior. Ideally, there’s just be something like cache: false in render.yaml, but that doesn’t exist. I could move the node_modules directory to somewhere that would be ignored by the cache step, but that’d break my application. Is there a way to do this?
Is there a reason your application couldn’t be configured to also look for dependancies in a different directory?
I’d also encourage you to submit a feature request to configure the cache behavior at https://feedback.render.com/. It helps to include as much context as possible about your use case, the problem you’re looking to solve, and how you’re getting around it today to help us develop the best possible solution.
We rely heavily on customer feedback as a part of our planning and product roadmap process, so capturing interest on the feature request page is very helpful.