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.pyโ€ - 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