I’m building a small Streamlit dashboard to sort through monthly CSV exports, with a few filters to narrow down the records. I’m still getting used to how Streamlit handles widget changes. Does every filter interaction trigger the script to run again, even when only one part of the page needs updating?
I’m trying to keep the dashboard responsive without doing unnecessary processing each time I change a selection.
Thanks for asking! Yes—by default, a widget change reruns the script from top to bottom. To keep the dashboard responsive, cache expensive CSV loading or processing with st.cache_data; for a filter that should update only part of the page, place that section in an @st.fragment. If you’d rather wait until users finish choosing several filters, group them in an st.form and process them on submission. Streamlit’s app model overview and execution-flow docs cover these options.