之间HttpRuntime.Cache和HttpContext.Current.Cache区别? [英] Difference between HttpRuntime.Cache and HttpContext.Current.Cache?

查看:196
本文介绍了之间HttpRuntime.Cache和HttpContext.Current.Cache区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是什么区别 HttpRuntime.Cache HttpContext.Current.Cache

推荐答案

我觉得以下从<一个细节href=\"http://theengineroom.provoke.co.nz/archive/2007/04/27/caching-using-httpruntime-cache.aspx\">http://theengineroom.provoke.co.nz/archive/2007/04/27/caching-using-httpruntime-cache.aspx

有关缓存我看着使用
  HttpContext.Current.Cache但经过
  阅读其他博客,我发现
  使用高速缓存使用的HttpContext
  HttpRuntime.Cache做实际
  缓存。使用的优点
  的httpRuntime直接的是,它是
  总是可获得的,例如,在
  控制台应用程序和单位
  试验。

For caching I looked into using HttpContext.Current.Cache but after reading other blogs I found that caching using HttpContext uses HttpRuntime.Cache to do the actual caching. The advantage of using HttpRuntime directly is that it is always available, for example, in Console applications and in Unit tests.

使用HttpRuntime.Cache很简单。
  对象可以存储在高速缓存和
  一个字符串进行索引。伴随着一
  键和缓存其他对象
  重要的参数是届满
  时间。此参数设置时间
  前的对象从丢弃
  缓存。

Using HttpRuntime.Cache is simple. Objects can be stored in the cache and are indexed by a string. Along with a key and the object to cache the other important parameter is the expiry time. This parameter sets the time before the object is dropped from the cache.

这是很好的链接给你的。

Here is good link for you.

另外一个很好的资源。

这篇关于之间HttpRuntime.Cache和HttpContext.Current.Cache区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆