在.net core中用IDistributedCache 操作分布式缓存
用什么做缓存
1.用数据库做缓存性能不好
2.Memcached缓存性能高,但是缓存健的长度为250字节限制,安装EnyimMemcachedCore
3.Redis推荐使用,Redis比Memcached性能稍差,但是高可用,数据量大场合使用。
1.先安装Redis
https://blog.csdn.net/qq_50598935/article/details/123934806
2. NuGet安装Microsoft.Extensions.Caching.StackExchangeRedis
3.注册服务
4.使用 IDistributedCache