Cache solution in ASP. NET (not just cache and session) (I argue with others on csdn)

Source: Internet
Author: User
I want to design a complete Buffer Solution ProgramBuffer data from various locations.

Application-level cache and application.
The user can understand session-level sessions, or not to mention

I want to talk about a smaller scope of application.

Thread level: cache that is valid only within a thread. For example, you can define a database connection object and buffer it at the Thread level. When performing various database operations, you don't have to worry about conflicts, because the current CPU only has one thread to execute. Our general approach to database connection is to declare a database connection within each object or pass it as an attribute outside the object. I think this approach is inconvenient. If we can achieve the line level, the cached database connection can be directly used within each data object in the data layer, without conflict, and the database connection is used to the maximum extent.

Request level: a cache that is valid only for a specific request. Sometimes, we all want to connect to the database once when the program is used. This request is always used to end. This is the request level.

I think the line level is better than the request level, because ASP. net is processed in this way. When a request is received, a thread is dispatched from the thread pool to process the request, and an httpapplication instance is also taken from the httpapplication instance pool for processing. Therefore, A thread can be used for multiple requests. An httpapplication instance may also be used for multiple requests.

After half a month of searching for information, I have already solved most of the problems, which are quite troublesome.
Now I want to hear from you and see if you have any better implementation methods.

Csdn address
Http://community.csdn.net/Expert/TopicView3.asp? Id = 5147435

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.