4 September 2011

Session Vs Caching in asp.net

Session Vs Caching in asp.net


1.Session is user specific and Caching is not user specific.

2. By using Cache, we can store it in memory, and directly bind the data. the memory of the machine/server from which the source code is running from.By using Cache, we can store it in memory, and directly bind the data.

3.But Session  is defined as a period of time that is shared between the web application and the user.It is only for particular user.

4.Caching is used to increase the performance of the application, and data is not frequently changing.

5.Session is used to store user specific values, and the data may or may not be frequently changing and it should be a small value.[For Performance].

6. If system is low on memory, asp.net will remove entries from Cache to free up memory.

7. Session is per user basis, so if you store a value in session, for each user different memory will be allocated. However flexibility is that you can keep different value for different user.

8. In cache value remains the same for all users and it is a memory efficient solution when you want to share a common value between different users.




No comments:

Post a Comment

Comments Welcome

Implementing OAuth validation in a Web API

 I mplementing OAuth validation in a Web API Implementing OAuth validation in a Web API using C# typically involves several key steps to sec...