Welcome to the community and thanks for your detailed question! What you’re seeing is expected behavior in Streamlit and Python. Expired cache entries (from @st.cache_data(ttl=…) ) are only removed from memory when the cached function is called again, not automatically in the background.