What is the difference between HttpContextclass Cacheand Itemsproperties?
In the MSDN documentation:
Cache
Gets the Cache object for the current application domain.
Elements
Gets a collection of keys / values that can be used to organize and exchange data between the IHttpModule interface and the IHttpHandler interface during an HTTP request.
I really don't understand what this documentation is trying to explain.
While working on ASP.NET web applications, I often used Itemsto cache data for each request so that multiple user controls do not view the same data from the database. This is described in this article .
Today, although I came across using a property Cachefor what looked like caching on demand. I tried to understand the difference, but could not find good documentation by comparing the two. So I would like to know ...
What is the difference between the HttpContext Cache and Items properties? Try to explain examples of why you decided to use one above the other in different real-world scenarios.
source
share