st.cache_data caches results from data-loading helper functions so datasets are not reloaded whenever a user performs an action, such as changing a dropdown. section 11.2.2
Apply it by wrapping a helper function with the decorator, then call that function when preparing data for the Streamlit app.
Caching house-price data
@st.cache_data def get_price_data(): return helpers.load_price_data() wales = get_price_data()

