-
Notifications
You must be signed in to change notification settings - Fork 123
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
[Issue] How can I manually expire the cache in the following scenarios? #181
Comments
This is asking a lot of a cache library @neozhu. You will need some sort of cache invalidation strategy that keeps track of the types and their associated "primary keys" stored under each cache key. This is probably better handled at a level "above" the cache itself. To do it properly, the cache library would somehow have to know which of the types in the graph of objects you place into a cache bucket can be updated and what their "identity" is (i.e. primary key). Like, what if the cache bucket contained an object of type Aside: One major issue to note is that nodes other than the one that performed the SQL update may have in-memory cache keys that it doesn't. This would thus require a pub/sub mechanism to notify the other nodes that, e.g., |
You have to store in a list all the keys you generate. |
Thanks a lot for your advice. |
UPDATE: it is happening 🥳 Any help would be appreciated! |
Hi all, v2.0.0-preview-1 is out 🥳 🙏 Please, if you can try it out and let me know what you think, how it feels to use it or anything else really: your contribution is essential, thanks! |
Scenario 1:
I have a paginated query for a product table. I need to cache the data whenever users switch pages. Each page switch results in caching of data, where the cache key is defined as key=$"{pageindex}{pagesize}{keywords}". This works as intended.
However, if I execute a delete or insert operation on the Product table, I need to refresh the related cached data for the Product. Here, the paginated query's data usually needs immediate refresh.
Furthermore, if a user has cached data based on a ProductId, and this specific ProductId data has just been modified (for instance, the corresponding product was deleted or updated), that cache should also expire.
How can I achieve manual cache refreshing or expiration in these cases? @jodydonetti
The text was updated successfully, but these errors were encountered: