Skip to content

how do I clean the cache items by wildcard of a key #167

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

Closed
neozhu opened this issue Sep 19, 2021 · 2 comments
Closed

how do I clean the cache items by wildcard of a key #167

neozhu opened this issue Sep 19, 2021 · 2 comments

Comments

@neozhu
Copy link

neozhu commented Sep 19, 2021

I save the query cache by the paging parameters and field conditions.
e.g. cache key :$"{entityName}-{pageIndex}-{pageSize}-{filters}" : "Customers-1-30-"
I need to clean these cache items when I update customers data.
so, I want call cache.Remove("Customers-*") or any other solutions?

I saw that "Method 2 - Cancellation Tokens (could also be used to dispose a range of items)", but I use MediatR CQRS pattern in my project, how to use CancellationTokenSource

@alastairtree
Copy link
Owner

This is a duplicate of #74 so i will close it. Have a look at that as I have already proposed a way to achieve what you want.

@neozhu
Copy link
Author

neozhu commented Sep 20, 2021

thanks, I did it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants