gpt4 book ai didi

asp.net - HttpRuntime.Cache 和 HttpContext.Current.Cache 之间的区别?

转载 作者:行者123 更新时间:2023-12-03 05:35:51 29 4
gpt4 key购买 nike

HttpRuntime.CacheHttpContext.Current.Cache 之间有什么区别?

最佳答案

我从 http://theengineroom.provoke.co.nz/archive/2007/04/27/caching-using-httpruntime-cache.aspx 找到以下详细信息

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.

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.

Another good resource.

关于asp.net - HttpRuntime.Cache 和 HttpContext.Current.Cache 之间的区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/863654/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com