This article is a mirror article of machine translation, please click here to jump to the original article.

View: 13405|Reply: 1

[ASP.NET] Asp.Net cache

[Copy link]
Posted on 8/5/2016 6:32:43 PM | | |
The first is to use ASP's built-in cache, which stores object data in memory
Second, if in Mvc in the controller or code block use [OutputCache(Duration = 100)]
Third If it's an http request [WebMethod(CacheDuration=60)]
Fourth, if using webform in the code block, add [System.Web.UI.PartialCaching(120)]

If the amount of data is relatively small, it can be used
1.sessino  
<input id="HiddenValue" type="hidden" value="Initial Value" runat="server" NAME="HiddenValue">
ViewData
ViewState["Country"]
cookies
Query String


Of course, what are the benefits of using caching?
1. Performance, which can reduce the repeated creation, processing, and transmission of data, and cache the data without change, which can significantly improve the response speed of the web program;
2. Stability If the number of users on the same page is too large, if each request is processed, it will consume a great waste of resources and cause system instability
3. Availability Sometimes, some services that improve data are stopped, and at this time there is a cache, and the user continues to use it, which improves the availability of the system




Previous:C# is prone to problems when passing multiple parameters in a loop multithread
Next:C# Conversion between XML and entity classes (serialization and deserialization)
Posted on 8/6/2016 12:26:58 AM |
Caching is a good thing   
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com