I have a question.
I would like to create a program to delete all caches once an hour, but I can’t come up with an implementation idea.
If you have an implementation idea, please let me know.
Hi @akazdayo, great to see you back on our forums!
I haven’t tried this personally, but I believe you could use a combination of
st.cache_resource.clear() and Python’s
For instance, to clear the cache every hour, you can use Python’s
time module to track the elapsed time since the app started. When the elapsed time exceeds one hour, call the
st.cache_resource.clear() function to clear the cache and then reset the start time.
Hope that makes sense, and let me know if you need any help building this.