This is a mirror of official site: http://jasper-net.blogspot.com/

Difference between ASP.NET Sessions, Application variables and Cache objects.

| Tuesday, March 2, 2010
When developers start with ASP.NET Web Forms the question I always get is; where is the best place to store user information, the application variable, the session state, cookies, database or the cache objects?

This is not an easy answer there are so many variables and options. In a nutshell Session state can make a big difference depending there that session state is also stored, depending on so many factors, how many servers you going to need? how many users you need to support?

Please find the code below to test for yourself how Session, Application and Cache variables work.

In the previous post, you can see how Cache has a callback when the object gets remove from memory.

The difference from an Application variable and Cache is mainly that you can assign the time the Cache variable will be stored in memory.

Read more: Al Pascual

Posted via email from jasper22's posterous

0 comments: