HttpContext.Cache和HttpRuntime.Cache中的Cache
来源:互联网 发布:centos minimal full 编辑:程序博客网 时间:2024/04/30 06:52
这是MSDN提供的解释。
HttpContext.Cache:封装有关个别 HTTP 请求的所有 HTTP 特定的信息。
HttpRuntime.Cache:为当前应用程序提供一组 ASP.NET 运行时服务。
使用Reflector去查看其中的源代码
HttpContext.Cache:
public Cache Cache{ get { return HttpRuntime.Cache; }}
HttpRuntime.Cache:
public static Cache Cache{ get
{
if (AspInstallDirectoryInternal == null)
{
throw new HttpException(SR.GetString("Aspnet_not_installed", new object[] { VersionInfo.SystemWebVersion }));
}
Cache cache = _theRuntime._cachePublic;
if (cache == null)
{
CacheInternal cacheInternal = CacheInternal;
CacheSection cacheSection = RuntimeConfig.GetAppConfig().Cache;
cacheInternal.ReadCacheInternalConfig(cacheSection);
_theRuntime._cachePublic = cacheInternal.CachePublic;
cache = _theRuntime._cachePublic;
}
return cache;
}
}
结论是两者其实一样。
- HttpContext.Cache和HttpRuntime.Cache中的Cache
- HttpContext.Cache和HttpRuntime.Cache
- HttpContext.Cache 和 HttpRuntime.Cache
- HttpContext.Cache和HttpRuntime.Cache
- HttpContext.Cache和HttpRuntime.Cache
- HttpContext.Cache和HttpRuntime.Cache
- HttpContext.Current.Cache 和 HttpRuntime.Cache
- HttpContext.Cache和HttpRuntime.Cache的区别
- HttpContext.Cache和HttpRuntime.Cache的区别
- HttpContext.Current.Cache 和 HttpRuntime.Cache
- HttpContext.Current.Cache 和 HttpRuntime.Cache
- HttpContext.Current.Cache 和HttpRuntime.Cache的区别
- HttpContext.Current.Cache 和HttpRuntime.Cache的区别
- HttpContext.Current.Cache 和HttpRuntime.Cache的区别
- HttpContext.Current.Cache和HttpRuntime.Cache的区别
- HttpRuntime.Cache vs. HttpContext.Current.Cache
- HttpRuntime.Cache vs. HttpContext.Current.Cache
- HttpRuntime.Cache vs. HttpContext.Current.Cache
- ACE笔记(5) -ACE_Reactor 机制下的其他事件触发器
- ACE笔记(6) -Proactor机制下的异步SOCKET开发
- 25种提高网页加载速度的方法和技巧
- ACE笔记(7) -ACE单体实例、原语、锁、条件变量
- ACE笔记(8) -ACE智能指针
- HttpContext.Cache和HttpRuntime.Cache中的Cache
- 非递归的快速排序算法
- ACE笔记(9) -ACE日期时间类
- UML类图关系全面剖析和C++代码表现(转载)
- ACE笔记(10) -ACE文件操作
- ExtJS直接在页面显示日期和时间控件
- ACE示例 - ACE Proactor
- 数据接收中粘包及半包的处理
- ACE开发游戏服务器