-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
ability to auto-refresh Cache on schedule before it expires #794
Comments
@jackbond Issue with refreshing pre-emptively is that your cache grows monotonically i.e. you never remove anything from the cache. You might also need a cache counter so you only pre-emptively load if the item is frequently used. The multi-second first hit can't typically be avoided since you might need the latest. I'm about to hit this sort of stuff again on my project so I'll provide some feedback here once I have a result |
This issue is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days if no further updates are made. |
This is a feature we're unlikely to build into future releases of Polly. A more likely scenario is a package that builds on top of the .NET caching functionality might be made available (see #1127) where such functionality would be associated with the cache itself and Polly would itself not need to concern itself with any optimistic re-hydration of the cache. |
This issue is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days if no further updates are made. |
It will be good to have an ability to auto-refresh Cache on schedule before it expires similar as It is asked in https://stackoverflow.com/questions/44723017/in-memory-caching-with-auto-regeneration-on-asp-net-core and https://stackoverflow.com/questions/56412143/lazycache-regularly-refresh-cached-items
Describe your proposed or preferred solution:
Add optional Action<Context, string> onCacheExpired or
Action<Context, string> onCacheAboutToExpire and configuration aboutToExpireTimespan ( e.g. to start action 1 min before cache is expired)
Similar idea was discussed by @phatcher in #648 (comment)
The text was updated successfully, but these errors were encountered: