How to configure st.cache_data outside of Community Cloud

Hi. I’m using caching based on st.cache_data:

I read that caching isn’t fully supported in Snowflake:
https://docs.snowflake.com/en/developer-guide/streamlit/limitations#label-streamlit-limitations-caching

Now I’m deploying an app to GCP and wondering:

  • Is there any configuration for enabling caching?

The config docs doesn’t mention anything specific:

I’d appreciate any pointers.

Thanks,
-FGN.

Caching doesn’t have to be enabled; it just works. For reference, the reason it “doesn’t work” on Snowflake is because of security. In a Streamlit app, caching stores data that is accessible to all sessions. When an app is running in Streamlit in Snowflake, each viewer has their own Streamlit server running the app, so the cache isn’t available to the next user (who spins up their own server when they view the app). So caching works within a session in Streamlit in Snowflake.

For any other deployment, caching will work. As long as your Streamlit server is running and users connect to that same server without it restarting, the cached data will be available.

1 Like