Skip to content

Glossary: AI App Interfaces

@st.cache_resource

Also written: st.cache_resource, cache_resource

A Streamlit decorator that creates an object once and shares the same object with every session, such as an API client, a model, or the shared daily question counter. Use it for live objects, not for data you could save to a file.

Where the book teaches it

Related terms

CacheClient@st.cache_data