Replies: 4 comments 3 replies
-
The builder.Services.AddHybridCache(options =>
{
options.MaximumPayloadBytes = 1024 * 1024;
options.MaximumKeyLength = 1024;
options.DefaultEntryOptions = new HybridCacheEntryOptions
{
Expiration = TimeSpan.FromMinutes(5), // set global expiration here
LocalCacheExpiration = TimeSpan.FromMinutes(5)
};
}); |
Beta Was this translation helpful? Give feedback.
-
Hi folks, As an example, when a service is essentially acting as a reverse proxy for another backend, we want to be able to cache based off of the backend's Would it be possible to extend the HybridCache API to include a variant of |
Beta Was this translation helpful? Give feedback.
-
Hey, folks! @collinkruger and @zitzerd , currently, it is not possible and not part of the HybridCache design (yet); thanks for bringing these use cases. There is already an issue regarding this use case request: #56483 HybridCache: Enable setting expiration based on value in factory cc/ @mgravell |
Beta Was this translation helpful? Give feedback.
-
The demand is noted. We can try to look at what we can add here. |
Beta Was this translation helpful? Give feedback.
-
With the default MemoryCache i use the CacheEntry expiration options to specify the expiration based on the result of the non cached operation, getting an jwt accesstoken for example.
With HybridCache i only see ways to sepcify expiration as an HybridCacheEntryOptions prior to calling the GetOrCreateAsync, is there a way to set it inside?
thanks
Beta Was this translation helpful? Give feedback.
All reactions