微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

c# – System.Web.HttpContext.Current.Cache信息

我想询问System.Web.HttpContext.Current.Cache是​​否像Sessions一样是每个用户,还是每个应用程序.在哪种情况下使用Cache很好?

解决方法

HttpContext.Cache Property – MSDN

There is one instance of the Cache class per application domain.
As a result,the Cache object that is returned by the Cache property
is the Cache object for all requests in the application domain.

对于你的问题.

On which circumstances is nice to use Cache?.

将该信息保存在Cache中,该信息将由多个用户共享,并且(通常)如果其只读.例如,在缓存中保留查找值.你可能会看到:

Caching Data in an ASP.NET Web Pages Site for Better Performance

原文地址:https://www.jb51.cc/csharp/98837.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐