We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback
Platform : ASP.NET
Category : Miscellaneous

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

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.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon