Use atribute cache_data with argument persist="disk".
persist="disk"
import streamlit as st @st.cache_data(persist="disk") def get_some_data(): # ... function code! return result
Know more:
Reference: