-
Notifications
You must be signed in to change notification settings - Fork 102
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
[QUESTION] Are there any developments regarding integration with HybridCache and tags support? #273
Comments
Hi @valentinmarinro and sorry for the delay.
That's interesting to hear! May I ask which design you used to tackle the issues related to tag invalidation? Did it work well for you?
Yep, and as you can see I have not received an official asnwer yet. Having said that I've been able to chat a bit with Marc, but I'm waiting for something official to understand what they've been able to do for .NET 9 and how to move forward. Basically the point is that preview 7 seemingly just came out, and in general preview 7 is the last preview before the RC1/RC2 cycle, meaning it's the last possible moment where a change in the API surface area is possible: after this point, it's only invisible internal changes, perf boost, and stuff like that. The problem is that preview 7 does not currently have an official announcement yet (I mean like on DevBlogs), and the only thing I can see is this, but I don't knwo how "final" it is. So I'm waiting to know something "final". Anyway, what are your thoughts about the problems I highlighted in my comment over there? Anything to share?
Ahah, totally not! Ask freely about anything, I'm here to try to help 🙂 |
UPDATE: DevBlogs now has a post about preview 7, but no new info about HybridCache. |
Hey @jodydonetti , sorry for not responding to you sooner, we were caught in a release cycle and did not had the time to investigate your questions, but I found this proposal for HybridCache in aspnetcore repo: dotnet/aspnetcore#53255 , and tags are there. namespace Microsoft.Extensions.Caching.Distributed;
public abstract class HybridCache // default concrete impl provided by service registration
{
protected HybridCache() { }
// read-thru usage
public abstract ValueTask<T> GetOrCreateAsync<TState, T>(string key, TState state, Func<TState, CancellationToken, ValueTask<T>> callback, HybridCacheEntryOptions? options = null, ReadOnlyMemory<string> tags = default, CancellationToken cancellationToken = default);
public virtual ValueTask<T> GetOrCreateAsync<T>(string key, Func<CancellationToken, ValueTask<T>> callback,
HybridCacheEntryOptions? options = null, ReadOnlyMemory<string> tags = default, CancellationToken cancellationToken = default)
{ /* shared default implementation uses TState/T impl */ }
// manual usage
public abstract ValueTask<(bool Exists, T Value)> GetAsync<T>(string key, HybridCacheEntryOptions? options = null, CancellationToken cancellationToken = default);
public abstract ValueTask SetAsync<T>(string key, T value, HybridCacheEntryOptions? options = null, ReadOnlyMemory<string> tags = default, CancellationToken cancellationToken = default);
// key invalidation
public abstract ValueTask RemoveKeyAsync(string key, CancellationToken cancellationToken = default);
public virtual ValueTask RemoveKeysAsync(ReadOnlyMemory<string> keys, CancellationToken cancellationToken = default)
{ /* shared default implementation uses RemoveKeyAsync */ }
// tag invalidation
public virtual ValueTask RemoveTagAsync(string tag, CancellationToken cancellationToken = default)
{ /* shared default implementation uses RemoveTagsAsync */ }
public virtual ValueTask RemoveTagsAsync(ReadOnlyMemory<string> tags, CancellationToken cancellationToken = default) => default;
} |
Hi, I'm off for vacation |
I was wondering if there has been any update on the HybridCache in a while, I tried to use the built in one, but that doesn't seem to support circular references (and they don't seem to expose the STJ options (unlike FusionCache) but I was wondering when I can setup the plug and play with the hybrid cache |
Hi @HugoVG , the base features are already there in an experimental branch, meaning I'm able to use FusionCache as an implementation of HybridCache (of course with some reduced capabilities because of the simpler api surface area). The big feature that Regarding timing: the initial idea was to release a new version of FusionCache with both tagging support and the HybridCache compatibility at the official release of HybridCache, so in theory at the .NET 9 launch. I'm still pushing for this, but will release it only when it's done well, so it may be a little bit later than that. ps: I was wondering, why can't you just use FusionCache right now for the circular reference thing? It's that you prefer to depend on |
This sounds like a god send 🙏🏻 , can't wait for the the new release
yes I prefer to depend on HybridCache in most classes (coming from IMemoryCache), since we move a lot of implemantations, where some cases it might just be MemCache and other it is redis or sqlserver |
Wow, thank you so much @jodydonetti , I can wait to integrate FushionCache with tagging support in our microservices, this will give our microservices a new life and speed :) , we really appreciate the effort you put into this wonderful library. |
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! |
Hi @jodydonetti , we are heavily using tags invalidation in our project, we have a custom implementation based on MemoryCache and Redis and we would really love to switch to FusionCache for the backplane and auto-recovery features, but the missing tags support is a blocker for us.
We saw the thread discussion with Marc Gravel here dotnet/aspnetcore#55308 (comment)
Are there any new developments in this direction, for us only Redis is an option for L2 cache?
Hope I'm not too intrusive with my question :)
The text was updated successfully, but these errors were encountered: