-
-
Notifications
You must be signed in to change notification settings - Fork 498
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
pn.cache only caches for a session. #5109
Comments
I'm very confused by your example, the input to your cached function is a random array which is basically guaranteed to change each time. If you wrap the call to Closing this as there is no issue here. |
I'll add an argument to |
Looks like you are right. I overlooked this. Thanks |
panel==1.1.0
When working on the Streamlit Migration guide in #5027 I discovered that
@pn.cache
only caches for a user session. Not globally.Globally was what I and @philippjfr expected. Globally is what I need most often.
Reproduce
You can see how it reruns the
plot
function after a reload of the browser below.2023-06-14_05-47-41.mp4
Additional Context
You actually need to be able to both cache things for a users session and globally. Globally probably accounts for 99% of use cases though.
You could handle this by providing two caches:
If we just want the one we could describe in the documentation how to get the session id (I don't know how) and use this to cache for a user session. This documentation could be added to the cache documentation https://panel.holoviz.org/how_to/caching/index.html.
See also #5028 (comment) and #5028 (comment)
I'm on windows. Don't think it matters.
The text was updated successfully, but these errors were encountered: