# How to clear netlify-cli cache?

**URL:** <https://answers.netlify.com/t/how-to-clear-netlify-cli-cache/20766>\
**Category:** Support\
**Tags:** netlify-cli\
**Created:** [August 14, 2020, 2:03am UTC](https://answers.netlify.com/t/how-to-clear-netlify-cli-cache/20766 "2020-08-14T02:03:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![donovan](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/donovan/32/14520_2.png) [@donovan](https://answers.netlify.com/u/donovan)\
**Post date:** [August 14, 2020, 2:03am UTC](https://answers.netlify.com/t/how-to-clear-netlify-cli-cache/20766/1 "2020-08-14T02:03:29Z")

</div>

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)?

---

<div class="post-metadata">

**Author:** ![luke](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/luke/32/39_2.png) [@luke](https://answers.netlify.com/u/luke)\
**Post date:** [August 17, 2020, 5:44am UTC](https://answers.netlify.com/t/how-to-clear-netlify-cli-cache/20766/2 "2020-08-17T05:44:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![donovan](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/donovan/32/14520_2.png) [@donovan](https://answers.netlify.com/u/donovan)\
**Post date:** [August 17, 2020, 5:59am UTC](https://answers.netlify.com/t/how-to-clear-netlify-cli-cache/20766/3 "2020-08-17T05:59:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![perry](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/perry/32/16_2.png) [@perry](https://answers.netlify.com/u/perry)\
**Post date:** [August 21, 2020, 5:24pm UTC](https://answers.netlify.com/t/how-to-clear-netlify-cli-cache/20766/4 "2020-08-21T17:24:02Z")

</div>

hey there, thanks for that info.

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

> **[GitHub - netlify/cli: Netlify Command Line Interface](https://github.com/netlify/cli)**
>
> Netlify Command Line Interface. Contribute to netlify/cli development by creating an account on GitHub.

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