Closed PaulRReynolds closed 6 years ago
You can use a different CacheManager configuration with only one cache handle. For injection, I recently added some overloads to specify a configuration for a specific type.
See samples: https://github.com/MichaCo/CacheManager/blob/dev/samples/AspnetCore.WebApp/Startup.cs#L44
Great, thanks! That will work nicely, and it keeps the configuration at startup instead of when I use the cache.
Hi Michael,
I'm just working on an .Net Core application which will use CacheManager to cache a wide variety of data types, and I'm wondering what the best way is to handle some types differently to others?
Basically, I'm using a 2-level cache (MsMemory and Redis), with Redis Backplane. However, there are certain complex types which I only need to cache in-memory, and don't need to invalidate (they're generated in code and don't change). I want to avoid the serialization/network traffic I'd get pushing this up to Redis.
What's the best approach to take?
Here's my current config for my 2-level cache:
My Startup.cs looks like this: