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

Suggestion for GetWithExpiration method for expirable cache #174

Open
ardaasln opened this issue Mar 5, 2024 · 0 comments
Open

Suggestion for GetWithExpiration method for expirable cache #174

ardaasln opened this issue Mar 5, 2024 · 0 comments

Comments

@ardaasln
Copy link

ardaasln commented Mar 5, 2024

I think I have a use case for this.

In a highly concurrent traffic scenario, when an item is expired, many requests fail to get the value and hence, they flood the other data source (a db in my case). I am currently using https://github.com/patrickmn/go-cache and it has GetWithExpiration method so that before a minute when expiration occurs, a goroutine singlehandedly re-populates the cache (with the help of TryLock).

I might work on this if this sounds valuable.

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

No branches or pull requests

1 participant