I’d like to use the cached data history if it’s available
You can use the cached data by calling the cached function with the same params. Are you looking for something else?
Yes I’m doing that already. What does the max_entries arg do exactly? To me it sounds like the cache stores the last n number of items cached, if that’s the case, can they be accessed? I might just have the wrong end of the stick.
I am not sure I understand what you mean. Do you want to access cache entries after they’ve been removed from the cache because of the max_entries
param?
Caching overview - Streamlit Docs >> The max_entries
parameter
What does max_entries do? If it does what it sounds like, (setting the max number of items saved in the cache), then can we access those items? If we can’t do that, what is the point of saving those entries if the cache only returns the most recent item? Why bother storing more than 1 item in the cache?
It is unclear what you mean by that. There is no public API to directly access the cache, if that is what you are asking. You access it indirectly when you call a function decorated with @cache_data
.
I wonder what makes you think that. The cache can return any of the cached objects if asked for it.
I see now, of course, I’m just using cache_data with a single call with the same data but forgot the decorated function could be called with other params to get other data. My use case would be to add something like a timestamp to the function call to generate a cache with a history. That makes sense now, thanks!