1. What is the difference between Cache and Session?
2. I cache limited to page like viewstate or it's accessible
through out the application like session?
3. Which one is better when I've some data that is to be
used across the application? Why is to better than the other?

Answer Posted / vasanth

Caching is storing data in memory for quick access. Typically information that is costly to obtain (in terms of performance) is stored in the cache. One of the more common items stored in a cache in a Web application environment is commonly displayed database values; by caching such information, rather than relying on repeated database calls, the demand on the Web server and database server's system resources are decreased and the Web application's scalability increased.

Session variables can also be used to cache information in classic ASP, although, as with the cookie approach each session variable is specific to a particular user, and to tie a session variable to a particular user the user's browser must accept cookies. The advantages of using session variable's over cookies is that you can store objects, such as an array, or Dictionary object. Since session variables are stored on the Web server's memory, storing large objects in a user's session on a site with many simultaneous users can lead to reduced memory on the Web server.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

State differences between MVC and WebAPI

602


How do you implement postback with a text box?

558


what is AutoEventWireUp and what is the use of This property explain in details?

1126


Can we set which type of comparison we want to perform by the CompareValidator control?

514


How is it possible for .NET to support many languages?

302






How does asp page work?

544


What is postback in asp net?

562


Can we use a static function with a non-static variable?

505


What is AutoPostback?

593


What are all the various Estimation Techniques available ?

649


Explain the differences between clr & cts?

562


What is Partial PostBack in ASP.NET?

598


Why asp.net mvc is better than asp.net? : Asp.Net MVC

495


Explain login control and form authentication.

557


How to deploy/publish webservices?How many ways?Plz explain me

1835