Function signature[source] | |
---|---|
st.cache_data.clear(self) |
Example
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
@st.cache_data
def square(x):
return x**2
@st.cache_data
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
st.cache_data.clear()