Analysis of the difference between session cache and cache buffer in asp.net _ practical skills

Source: Internet
Author: User
A cookie is a set of data that is stored on the client and is used primarily to hold personal information such as user names.
Session saves the dialog information.

Application is the information stored throughout the application, which is equivalent to a global variable.
More sessions are used.

The difference between session caching and cache caching can be referred to the following points:

1, the biggest difference is that cache provides caching dependencies to update data, and session can only rely on the defined cache time to determine whether the cached data is valid.
2, even if the application terminates, the cached data still exists the next time the application is opened, as long as the cache time defined in the Cache.Add method does not expire. The session cache only exists in one session, and the data is invalidated after the conversation has ended.
3, session is easy to lose, resulting in the uncertainty of the data, and cache does not appear this situation.
4, because the session is loaded every time, so it is not appropriate to store a large amount of information, otherwise the performance of the server will be reduced. And cache is mainly used to save large capacity information, such as multiple tables in the database.
5. The beta version of VS2005 provides the parameters for saving the cache on the hard disk, but the feature is canceled in the official edition and is expected to be implemented again in later versions. The session can only be saved in memory and has an impact on its performance.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.