# Clear cache programmatically

**URL:** <https://discuss.streamlit.io/t/clear-cache-programmatically/19238>\
**Category:** Using Streamlit\
**Tags:** cache\
**Created:** [November 18, 2021, 9:26am UTC](https://discuss.streamlit.io/t/clear-cache-programmatically/19238 "2021-11-18T09:26:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![puzzled-cognition](https://avatars.discourse-cdn.com/v4/letter/p/9de0a6/32.png) [@puzzled-cognition](https://discuss.streamlit.io/u/puzzled-cognition)\
**Post date:** [November 18, 2021, 9:26am UTC](https://discuss.streamlit.io/t/clear-cache-programmatically/19238/1 "2021-11-18T09:26:39Z")

</div>

Is there a way to clear cache inside the python script?

Tried the following but I assume the api is available no more:

```auto
from streamlit import caching
caching.clear_cache()

```

---

<div class="post-metadata">

**Author:** ![DittoAsnar](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/dittoasnar/32/12270_2.png) [@DittoAsnar](https://discuss.streamlit.io/u/DittoAsnar)\
**Post date:** [December 27, 2021, 1:42pm UTC](https://discuss.streamlit.io/t/clear-cache-programmatically/19238/2 "2021-12-27T13:42:48Z")

</div>

I’m curious about this also

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/streamlit/original/3X/c/f/cf4c2ee0d938358f82448c5fe4b9c3c91d7ce19c.svg) [@system](https://discuss.streamlit.io/u/system)\
**Post date:** [December 27, 2022, 1:43pm UTC](https://discuss.streamlit.io/t/clear-cache-programmatically/19238/3 "2022-12-27T13:43:17Z")

</div>

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
