I would like to ask if System.Web.HttpContext.Current.Cache
is per User like the Sessions
or if it is per application. On which circumstances is nice to use Cache?.
HttpContext.Cache Property - MSDN
There is one instance of the Cache class per application domain. As a result, the Cache object that is returned by the Cache property is the Cache object for all requests in the application domain.
For your question.
On which circumstances is nice to use Cache?.
Keep that information in Cache which will be shared by multiple users and (usually) if its readonly
. For example keeping lookup values in cache. You may see:
Caching Data in an ASP.NET Web Pages Site for Better Performance
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With