Clear all in-memory and on-disk data caches.

Function signature[source]



In the example below, pressing the "Clear All" button will clear memoized values from all functions decorated with @st.cache_data.

import streamlit as st

def square(x):
    return x**2

def cube(x):
    return x**3

if st.button("Clear All"):
    # Clear values from *all* all in-memory and on-disk data caches:
    # i.e. clear values from both square and cube

Still have questions?

Our forums are full of helpful information and Streamlit experts.

Was this page helpful?

editEdit this page on GitHub