Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Consider unification between IMemoryCache and IDistributedCache. #220

Closed
msmolka opened this issue Aug 20, 2016 · 3 comments
Closed

Consider unification between IMemoryCache and IDistributedCache. #220

msmolka opened this issue Aug 20, 2016 · 3 comments

Comments

@msmolka
Copy link

msmolka commented Aug 20, 2016

Currently both interfaces has different methods and extensions, which is making switching between them quite hard. Also memory cache has more methods that simplifying usage of caching.

@msmolka msmolka changed the title Consider unirication between IMemoryCache and IDistributedCache. Consider unification between IMemoryCache and IDistributedCache. Aug 20, 2016
@davidfowl
Copy link
Member

They can't be unified, that would be a breaking change. They shouldn't be unified, they have fundamentally different semantics. MemoryCache can store live objects, the distributed cache can't, objects have to be serialized. The distributed cache can be off box and calls to it may fail or take a long time so getting and setting should be async, the MemoryCache is always in memory and fast. The distributed cache can be disconnected from the store so the interface should account for that.

It's like trying to unify IDictionary<object, object> with a redis client interface. It's apples and oranges.

@Tratcher
Copy link
Member

That said, there is an implementation IDistributedCache that used memory cache to simplify switching back and forth.

@muratg
Copy link

muratg commented Sep 23, 2016

Breaking change. We can't do this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants