-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Pre-cache on start-up #6108
Copy link
Copy link
Closed
Labels
feature:cacheRelated to `st.cache_data` and `st.cache_resource`Related to `st.cache_data` and `st.cache_resource`type:enhancementRequests for feature enhancements or new featuresRequests for feature enhancements or new features
Metadata
Metadata
Assignees
Labels
feature:cacheRelated to `st.cache_data` and `st.cache_resource`Related to `st.cache_data` and `st.cache_resource`type:enhancementRequests for feature enhancements or new featuresRequests for feature enhancements or new features
The
st.cacheis really useful (I'm still on 1.13) but I think its user-friendliness can be improved. Now, the first run still takes a long time for the first user. But it would be useful if we can "pre-cache" the result of a function so that even the first user does not have to wait too long for long running processes, e.g. for downloading a ML model behind the scenes. A solution would be to add an option to st.cache like "precache" that accepts a list of dicts, where each dict is a kwarg for the function. On app start up, the function is then run for all those different types of kwargs.It's just an idea but I think it could be useful!