alastairtree / LazyCache

An easy to use thread safe in-memory caching service with a simple developer friendly API for c#
https://nuget.org/packages/LazyCache
MIT License
1.71k stars 159 forks source link

How to create separate caches? Not seeing how this is done. #180

Closed SoulFireMage closed 1 year ago

SoulFireMage commented 1 year ago

[Use the Thumbs Up reaction to vote for this feature, and please avoid adding comments like "+1" as they create noise for others watching the issue.]

How do you configure the cache to be separate instances? I've tried having private static versions within several types in my project, however when I debug, one single cache instance shows caching from multiple types.

My project is a rather large monolith where I may, in some cases, cache a few thousand items of a type. I'd like to be able to separate out the various caches rather than have one single dictionary for all the many types I may cache.

I've not seen it in the documentation so far :)

Thank you!

alastairtree commented 1 year ago

Thank for the suggestion. I think this is the same as https://github.com/alastairtree/LazyCache/issues/166 so will close as a duplicate.