Clearing the cache memory for one Function only

Hi everyone! I am here with another question and hopefully some of our smart people here can guide me.
I am building this application that gets a ton of data from different sources. I used the st.cache_data to save the data in the memory and make the code run faster. Now I am having a problem when the user decides to change one of the data sources. I can use st.cache_data.clear() to remove the old data and store the new one. The problem is that this clears all the data that was previously stored instead of just one data source. Is there any way where I can select which decorated function with the st.cache.data gets cleared?

Functions can be cleared, have a look on this post. There seems to be an issue on version 1.20.0. You can try 1.19.0.

Ferdy you are the best! It worked perfectly. Thanks a lot and have a wonderful weekend

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.