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?

Answers were Sorted based on User's Feedback



1. What is the difference between Cache and Session? 2. I cache limited to page like viewstate or i..

Answer / praveen singh

1.
A. Sessions may not improve performance whereas Cache will
improve site performance.

B. Sessions may change from user to user whereas a single
Cache will be maintained for the entire application.

C. Cache wont maintain any state, whereas Sessions will
maintain separate state for every user.

2.
Yes Cache is accessible through out entire application
3.
Application beacuse application object is share by entire
application.

Is This Answer Correct ?    17 Yes 1 No

1. What is the difference between Cache and Session? 2. I cache limited to page like viewstate or i..

Answer / 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

More ASP.NET Interview Questions

Can we have multiple web config files for an asp.net application?

0 Answers  


What are the difference between overriding and overloading?

0 Answers  


About Usage of server variables ?

2 Answers   Cognizant, CTS,


When is the ViewState available during the page processing cycle ?

6 Answers   Siebel,


How do you create a master page?

0 Answers  






what is view stat how it is use ?

2 Answers   Amazon,


difference between Trace and Debug ?

9 Answers   Accenture, Addlux, Microsoft,


What are web beacons used for?

0 Answers  


I have one application, one user purchase some products in my application? and another person came he is also purchase some products?how can we identify which user purchase which items? my answer is by using session id? but i dont know how? can u give me programming for that?

1 Answers  


What is the use of the tag in the web.config file?

0 Answers   MindCracker,


How much is the pay-for-use service if I chose not to use microsoft-sponsored advertising?

0 Answers  


How to automatically get the latest version of all the asp.net solution items from source safe when opening the solution?

0 Answers  


Categories