You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[API Proposal]: hybridcache, Add expiration logic to GetOrCreateAsync #6434
Memorycache has a GetOrCreateAsync method that allows the factory to determine the expiration. This is very useful when caching (for instance) access tokens. The hybridcache currently doesn't have this option. The workaround would be to do a manual get, and then, when the entry is not in the cache, do the factory manually, and do a SetAsync. Howerver, hybridcache doesn't even have a getasync
Activity
jodydonetti commentedon Jan 7, 2026
Hi @PaulVrugt
As a (temporary?) fix you may look into using the FusionCache based implementation of HybridCache, see here.
It also has a backplane to keep the cache coherent even in a multi-node environment, and that also works with the HybridCache impl.
It's a 100% compatible drop-in impl replacement, no code changes required except for 1 line during setup.
Hope this helps.
NB: FusionCache creator here, just to be clear.