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

Invalidating the cache #175

Closed
ChetanBhasin opened this issue Feb 5, 2019 · 1 comment
Closed

Invalidating the cache #175

ChetanBhasin opened this issue Feb 5, 2019 · 1 comment

Comments

@ChetanBhasin
Copy link

Perhaps it's possible and I cannot find it, but the default caching solution does not have a way to invalidate a cache item.

This would be super useful for designs when something has changed, through a pub-sub mechanism the application can discard an entry in the cache.

@purrgrammer
Copy link
Contributor

Perhaps it's possible and I cannot find it, but the default caching solution does not have a way to invalidate a cache item.

Exactly, the default implementation is an in-memory cache that has no way to invalidate its items. Take into account that Fetch wants to guarantee that if you ask for the same value more than once inside a Fetch execution it is only fetched once.

However, nothing is stopping you to implement a custom cache that has a finite time to live. See the examples folder for an example of a custom cache implementation.

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

2 participants