Open alastairtree opened 5 years ago
Would it be possible to add this as an extension package, i.e. LazyCache.Distributed
, to avoid adding the extra dependencies?
To be honest, I think with this impl the Lazy part is lost and that's something I don't want to happen. So that leads me to consider the use of what you mentioned a Hybrid Mechanism that will allow the cache to be stored initially in memory and then once the value is obtained in the DistributedCache!
By the way there are some test not passing. I think they are more related to the MemoryCache
Got some changes take a look all test passed but we can't use the check by reference.
There is loads of great work in here, thank you! I like the mongo db BSON serialisation and implementation in the cache provider.
The approach you have taken is to pretty much create a new version of LazyCache but backed by IDistributedCacahe. What would be the benefits of using this over just using IDistributedCacahe directly? Do you still get any of the lazy behaviour?
When I was thinking about it originally I was wondering if there was a way to give users a way to start on an in-memory cache and then upgrade to distributed with a small config change rather than having a changed API surface. We could also add a hybrid model with both in-memory and distributed cache if they shared the same IAppCache contract. I think i might need to take some time to have a look a bit deeper and consider the best way to pull in something like this.