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

Feature: ReadThrough mode #381

Closed
bartelink opened this issue May 12, 2023 · 1 comment · Fixed by #386
Closed

Feature: ReadThrough mode #381

bartelink opened this issue May 12, 2023 · 1 comment · Fixed by #386

Comments

@bartelink
Copy link
Collaborator

The current AllowStale option will use any cached state as held

Being able to constrain it to only use the state if it's within a certain age range will enable users to trigger periodic re-reads to freshen the state

To facilitate heavy usage as a read-through cache, reads under this mode should be concentrated internally via an AsyncCacheCell in order to ensure a timeout does not read to a flurry of concurrent update attempts

NOTE just letting the underlying entry in the MemoryCache expire is insufficient - we still need to have the entry be usable as base state for the read (e.g. in order to allow etag checked reads) and to be able to use it to control the single reader gating

@nordfjord
Copy link
Contributor

This would be amazing. This has been a significant reason for me avoiding the AllowStale option. In most cases I'd be fine to use the state within e.g. 60 seconds, but if it's older than that it's usually no longer fresh enough for use in the query methods.

This was referenced May 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants