How to clear netlify-cli cache?

Apologies if this is a silly question or already answered in docs (I can’t find it), but how do I manually clear netlify-cli cache?

I’m using Gatsby incremental builds but building locally. I need to clear netlify-cli cache because it’s not re-indexing my ElasticLunr search.

Where is the cache stored (Ubuntu)?

Hi, @donovan, the Netlify CLI tool doesn’t use a local cache. If something is being cached, it is being cached by your local build tools and not the CLI tool.

I could be misunderstanding what you are trying to do. If so, more details about your workflow might help us to better answer this question.

Hi Luke,

So the ElasticLunr plugin for Gatsby rebuilds its index with each gatsby build.

But if I run netlify build, it doesn’t rebuild the index (even though it’s basically still running gatsby build).

In order to get it to rebuild the Elastic search index, I have to first run gatsby build on its own, and then run netlify build && netlify deploy.

It’s weird I know. I’m not sure why this is happening. I assumed it was something to do with Netlify incremental builds and Gatsby basically skipping the Elastic search index because it’s cached.

hey there, thanks for that info.

I’m not a CLI expert, but you might check in the issues here:

and potentially file an additional one if you feel like this is a bug, so that we can take a closer look?