When to use HttpApplicationState and not Web.Caching.Cache?

When I need to cache something in my application, I used to select Web.Caching.Cache. But I came across some outdated code using HttpApplicationState.

Since Web.Caching.Cache is more powerful and flexible (it seems, MUCH more), is there a situation that is better to use HttpApplicationState ??

I would really appreciate it if you can show me some examples :-)

+5
source share
1 answer

Both HttpApplicationState and Web.Caching.Cache can be used to store information that can be globally accessible in an ASP.Net application. However, they have a completely different application.

HttpApplicationState , . Application_Start global.asax, . , , , , . - , . , Application_State .

, . , , Application.Lock() Application.UnLock().

ASP.Net: , . , , . ASP.Net , . ApplicationState Cache : 1) (, ..), ApplicationState , , 2) , , , , , , , , ApplicationState .

, . , .

+13

All Articles