-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to clear the cache with each run #870
Comments
Hey @ssimontacchi , thanks for using Streamlit ! It seems that your needing is related with this issue Let us know if this helps you |
Thanks! My issue is that wherever I seem to put it in my code, it clears the state every time a button is pressed or slider is moved. Do you know what I am doing wrong? |
Do you have a minimal example with the problem ? so I can help you with With cache you refer to this streamlit function ? https://streamlit.io/docs/api.html#streamlit.cache or are you referring to the current app state ? if so could be related to this |
Sure, if I implement this code block it shows the conundrum. Again, I'm looking to keep the state and only clear it with a refresh of the page. I get the same issue if I wrap the button in a function. Thanks!
|
Is there a way to count how many times the report has been run since the last time the cache was cleared? |
I just added a reset button... Good enough for me! :) |
The app's flow just isn't quite right without an autoreset. Any advice would be awesome! |
Hey @ssimontacchi , You could use the unofficial https://discuss.streamlit.io/t/preserving-state-across-sidebar-pages/107/2?u=jonathan_rhone https://gist.github.com/tvst/036da038ab3e999a64497f42de966a92 |
Hi, how to clear the cache for a specific session?? Is there any hack to do it? |
Hi @starrabb1t , maybe this thread helps you, if not please open a new discussion here with your use-case |
First off, Streamlit is awesome.
I am making an app where every time you push a button the state changes, but I would like to clear the cache the first time the script is run. So every time the page is refreshed, the cache is cleared.
Thanks for your help!
The text was updated successfully, but these errors were encountered: