HttpRuntime.Cache 与 HttpContext.Current.Cache

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

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

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

注意:是同一个对象。
比如:

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

aa的值也是"test"

原文地址:https://www.cnblogs.com/zhaogaojian/p/11722204.html