13 questions
Advice
0
votes
1
replies
72
views
How to effectively use ASP.NET core Hybrid Cache with Result<T> type
Suppose a scenario where:
you need to execute an expensive operation which can fail or succeed.
the result of the operation is modeled by using a result object Result<T>. The result object ...
1
vote
1
answer
268
views
How can you mock a caching service that in turn uses HybridCache?
I have a factory class that let's say for arguments sake returns a car:
public class CarFactory : ICarFactory
{
private const string carKey = "MyCarKey";
private readonly ...
0
votes
1
answer
242
views
.NET 9 HybridCache tags
I have started using version 9.3.0 of HybridCache in .NET 9 (Microsoft.Extensions.Caching.Hybrid).
It appears that the RemoveByTagAsync method doesn't work in Redis. The cache items remain after ...
1
vote
1
answer
287
views
What's the default value for LocalCacheExpiration and Expiration in HybridCache
What's the default value for LocalCacheExpiration and Expiration in HybridCache.
You can set these values in HybridCacheOptions.HybridCacheEntryOptions but the source doesn't mention the default value,...
2
votes
1
answer
422
views
How Microsoft HybridCache works in a Microservice Setup with Multiple Pods
The Microsoft.Extensions.Caching.Hybrid package (available in .NET 9) provides a hybrid caching mechanism that allows you to combine both in-memory caching (for fast local access) and distributed ...
3
votes
2
answers
229
views
How can I use NodaTime with redis?
I am using the HybridCahce implementation from .net 9, with a DragonFly instance as the distributed cache, and works as expected with:
builder.Services.AddStackExchangeRedisCache(options => options....
4
votes
2
answers
3k
views
How to update existing cache using HybridCache in .NET 9
I am trying to see if I can update a cached collection (in memory) using HybridCache.
When using MemoryCache, I can do something like this, this was an easy "hack" to update collection ...