Skip to content
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

Add refresh feature to cache #8645

Open
2 tasks done
PaleNeutron opened this issue May 13, 2024 · 1 comment
Open
2 tasks done

Add refresh feature to cache #8645

PaleNeutron opened this issue May 13, 2024 · 1 comment
Labels
feature:cache Related to st.cache_data and st.cache_resource type:enhancement Requests for feature enhancements or new features

Comments

@PaleNeutron
Copy link
Contributor

PaleNeutron commented May 13, 2024

Checklist

  • I have searched the existing issues for similar feature requests.
  • I added a descriptive title and summary to this issue.

Summary

Current cache is very simple and developer can not avoid user from waiting since cache only refresh after expired.

For example, a function takes 1min, cached 1 hour. User have to wait 1min every hour.

The refresh idea is return cached result but still run the decorated function and refresh cache in the background.

Why?

Make user do not hang on any cached function.

How?

There can be two implementation.

  1. https://github.com/AmadeusITGroup/RedisCache?tab=readme-ov-file#cache-decorator like refresh param here.
  2. like Cache-control: no-cache, force rerun cached function before ttl and store result into cache. developer can trigger it by cron and keep cache always available for user.

Additional Context

No response

@PaleNeutron PaleNeutron added the type:enhancement Requests for feature enhancements or new features label May 13, 2024
Copy link

To help Streamlit prioritize this feature, react with a 👍 (thumbs up emoji) to the initial post.

Your vote helps us identify which enhancements matter most to our users.

Visits

@raethlein raethlein added feature:cache Related to st.cache_data and st.cache_resource impact:users labels May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:cache Related to st.cache_data and st.cache_resource type:enhancement Requests for feature enhancements or new features
Projects
None yet
Development

No branches or pull requests

3 participants