MemoryCache 和 IDistributedCache 的区别

https://github.com/aspnet/Caching/issues/382

System.Runtime.Caching/MemoryCache 是用来存储普通 .net 对象的,其中可以存储任意 object graph. 是原始对象,无需序列化;

而 IDistributedCache 接口是用来存储字节数组的。必须是序列化后的结果。其具体实现可以是 sql server, redis 等。

猜你喜欢

转载自www.cnblogs.com/new-start/p/13211386.html