-
-
Notifications
You must be signed in to change notification settings - Fork 318
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
Get cache key generated and used by FromCache #818
Comments
Hello @fenomeno83 , I'm not sure if that will answer your question or not but: You can create your own cache key by using this factory: https://github.com/zzzprojects/EntityFramework-Plus/blob/master/src/shared/Z.EF.Plus.QueryCache.Shared/QueryCacheManager.cs#L209 Or you can create your own implementation of the Let me know if that answers your question. Best Regards, Jon |
Thanks for response! So I'd like have as FromCache output these 2 info that says what FromCache has done. |
something like this (see key and isNewKey)
So, if fromcache make to this automatically I'd like know what has done, without make a my implementation |
Hello @fenomeno83 , Unfortunately, we do not expose what you are looking for directly from the method. But if you look at our implementation, you could probably create your own method as everything you need is public and you have access to it. For example:
Best Regards, Jon |
Ok thanks, in this manner I can get the 2 info
|
So, I've created and extension method that wraps FromCacheAsync and do what I need This is the original query
It became:
|
Hello @fenomeno83 , Awesome, I'm happy you succeeded in making it work. Can we close this issue as I don't think at this moment we will include it in our base library? Best Regards, Jon |
Yes..thanks |
In there a manner to get generated cachekey (based on query and parameters) by FromCache/FromCacheAsync?
I'd like send cache data via api to all other nodes, so when a node execute query, set own cache (automatically with FromCache), and send the cache data with cache key to all other nodes.
So all other nodes if execute query with same parameters using FromCache, no need to execute on database because use cache (that has sent the first node).
Is a manner to sicronize cache without use a distribuited server cache
Thanks
The text was updated successfully, but these errors were encountered: