batman
1
Can @st.cache be used in functions from a file that’s going to be imported?
Example:
-- app.py
from utils import func
text = func()
-- utils.py
@st.cache
def func():
print("hello")
Will cache work as expected if only the functions in utils.py
have the cache decorators?
ferdy
2
1 Like
batman
4
Thanks, but this question is about how to use when importing from other files rather than the cache data/resource 
I managed to figure it out by experimenting though. I can indeed use the decorator on functions in other files that I want to import 
1 Like
I have the same question, whether we have to define function in the same pages?