ASP.NET Core中的分布式缓存
ASP.NET Core中的分布式缓存 在上 一篇文章中 [1] ,我解释了如何使用 内存缓存 在ASP.NET Core应用程序中管理 缓存 。 如果您的应用程序托管在单个服务器上,则可以使用这种类型的缓存。 那.NET Core框架可以使用哪些工具在云中的分布式方案中进行缓存呢 IDistributedCache接口 该框架提供以下接口: public interface IDistributedCache { byte [] Get ( string key ); Task < byte []> GetAsync ( string key ); void Set ( string key , byte [] value , DistributedCacheEntryOptions options ); Task SetAsync ( string key , byte [] value , DistributedCacheEntryOptions options ); void Refresh ( string key ); Task RefreshAsync ( string key ); void Remove ( string key ); Task RemoveAsync ( string key ); } 如果您还记得上一篇文章( IMemoryCache