Auto refreshing a multipage app


i created a multipage app that displays a dataframe which gets updated in regular intervals using streamlit autorefresh component and by using st.cache to not get updated whenever there is a user_interaction , but when page is not opened the st_autorefresh is not getting triggered , so when page1 is opened it is getting refreshed but page 2 is not getting refreshed in the interval and when i open page2 since the cache got cleared it is getting refreshed due to user_interaction.

Steps to reproduce

i tried to reproduce this issue by creating a similar problem

Code snippet:
β€œ” - main_page

import streamlit as st
import time
import pandas as pd
from datetime import datetime
from streamlit_autorefresh import st_autorefresh


if "count1" not in st.session_state:
if "time" not in st.session_state:
    st.session_state.time = (time_threshold*60)

def hi(y):
    now =
    time_formatted = now.strftime("%d/%m/%y %H:%M:%S")



st_autorefresh(interval=st.session_state.time*1000, key="main_Refresh",debounce=False)


import streamlit as st
import pandas as pd
import time
from datetime import datetime
from streamlit_autorefresh import st_autorefresh


if "count" not in st.session_state:
if "time1" not in st.session_state:
    st.session_state.time1 = (time_threshold1*60)

def hello(y):
    time2 =
    time_formatted = time2.strftime("%d/%m/%y %H:%M:%S")



st_autorefresh(interval=st.session_state.time1*1000, key="main_Refresh",debounce=False)

If applicable, please provide the steps we should take to reproduce the error or specified behavior.

Expected behavior:

the page gets refreshed even when the page is not open at the given intervals

Actual behavior:
the page is getting refreshed only when the page is opened

Debug info

  • Streamlit version: 1.24.1
  • Python version: 3.11.2
  • Using PyEnv
  • OS version:
  • Browser version:

Appreciate any replies
Thank you

Hi @saitharun_gunasekar,

Thanks for sharing this question. Just to clarify – you want a specific page in your multipage app to autorefresh using the streamlit_autorefresh package even if the user is not viewing that page?

yes @Caroline

Any update on this @Caroline

I wrote a response to this in the GitHub issue for autorefresh Auto refreshing a multipage app Β· Issue #9 Β· kmcgrady/streamlit-autorefresh Β· GitHub

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