What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 28252 |  Welcome, Guest!   Register  Login
 Home > Interview Questions > ASP.NET Interview Questions > Difference between Session and Cache ? . ...

Difference between Session and Cache ?

Interview question and answer by: Bharathi Cherukuri | Posted on: 4/20/2012 | Category: ASP.NET Interview questions | Views: 1229 | | Points: 40


Answer:

The main difference is session is per user, while cache will be for application scoped items.

1) Items put into a session will stay there, until the session ends, whereas Items in the cache can expire (will be removed from cache) after a specified amount of time. And also there is no guaranty that objects will not be removed before their expiration times as ASP.NET remove items from cache when the amount of available memory gets small. This process is called as Scavenging.

2) The session state can be kept external (state server, SQL server) and shared between several instances of your web app (for load balancing).
This is not the case with the cache.

Asked In: Many Interviews | Alert Moderator 
Found interesting? Add this to:


 Responses

Posted by: Akiii | Posted on: 23 May 2012 09:34:58 PM | Points: 10 | Alert Moderator 

good explanation Bharathi...


Thanks and Regards
Akiii

Posted by: Bharathi Cherukuri | Posted on: 24 May 2012 01:19:21 AM | Points: 10 | Alert Moderator 

Thanks Akiii

Regards,
Bharathi

>> Write Response - Respond to this post and get points

Even more ... | Submit Interview Questions and win prizes!

More Interview Questions from Bharathi Cherukuri

Even more ... | Submit Interview Questions and win prizes!


About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/24/2013 10:51:12 AM