Live Chat Icon For mobile
Live Chat Icon

What are the pros and cons of using Session or Cache to save intermediate state?

Platform: ASP.NET| Category: Miscellaneous

To store in Session:


  • It’s stored per user session
  • It’s just a handle to a live object, if using InProc
  • If you use StateServer or SQLServer mode, you can access your session state across the webform. (can’t use InProc mode in webform)


  • If you use StateServer or SQLServer mode, your object must be serializable, and you pay the performance cost of network traffic + serialization cost

To use cache:


  • It’s always stored as just a handle to the live object
  • Can use cache dependencies or other cache features to control its lifetime
  • Can be shared by all users on that web server


  • It’s per app-domain per web server.

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.