Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
查看MSDN doc for .NET 2.0 of the HttpContext.Cacheobject 它说:
HttpContext.Cache
当前 HTTP 请求的缓存。
但是看看.NET 3.0版本它说:
当前应用程序域的缓存。
这是功能上的一个非常显着的差异。我使用它的经验一直是它是一个Per Request缓存。但是文档似乎不同意我的观点。正确的用法是什么?MSDN 文档错了吗?
功能没有改变,只有描述。
“The Cache for the current HTTP request”是“The Cache for the current application domain”,即当前请求正在执行的应用程序域。