HttpRuntime.Cache 与 HttpContext.Current.Cache

一、HttpRuntime.Cache是应用程序级别的,spa

二、而HttpContext.Current.Cache是针对当前WEB上下文定义的。code

三、这二个都是调用的同一个对象,不一样的是:HttpRuntime下的除了WEB中可使用外,非WEB程序也可使用。对象

注意:是同一个对象。
好比:blog

Page.Cache["aa"] = "test";
var aa=HttpRuntime.Cache["aa"];

aa的值也是"test"class

相关文章
相关标签/搜索