Nx: [question] clearing/pruning NX Cache

Created on 21 Apr 2020  路  3Comments  路  Source: nrwl/nx

This is no issue, but a question. We are using the cache created in node_modules/.cache/NX in our CI environment. We distribute the NX cache between our agents. The size of the cache enlarges fast :).

Is there a way to clear this cache, if possible by a certain depth?

I have searched the examples for distributed NX and the source code, but did not find this option. But maybe I have overlooked it :).

misc question / discussion

Most helpful comment

@FrozenPandaz "The best solution" is always relative to a point of view. For me the best solution has to be open source for instance. So having a way to clear the cache, for those of us managing it on our own infrastructures, specifying for instance "only the cache of Cypress" would be useful :slightly_smiling_face:.

All 3 comments

Is there a way to clear this cache

  • you can move it outside node modules and rm -rf on it (ofc that can be done within node_modules)
    image

if possible by a certain depth

  • I don't think so (@jaysoo pls correct me if I'm wrong)

Nx Cloud is the best solution for distributing the cache for CI and local development as it stores the cache on a remote server.

Not sure what would classify as the depth of the cache. I think if you were caching this in CI, you would likely want to do it per PR... so that it clears.

Hopefully, that answers the question.

@FrozenPandaz "The best solution" is always relative to a point of view. For me the best solution has to be open source for instance. So having a way to clear the cache, for those of us managing it on our own infrastructures, specifying for instance "only the cache of Cypress" would be useful :slightly_smiling_face:.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ZempTime picture ZempTime  路  3Comments

jasedwards picture jasedwards  路  3Comments

zpydee picture zpydee  路  3Comments

Koslun picture Koslun  路  3Comments

MichaelWarneke picture MichaelWarneke  路  3Comments