Original: http://blog.csdn.net/wyxhd2008/article/details/8076105
Catalogue (?) [-]
- full parsing of the system cache 1 Overview of System caching
- full parsing of the system cache 2 page Output Caching
- full parsing of the system cache 3 page Local Cache
- full parsing of the system cache 5 File Cache Dependency
- full parsing of the system cache 6 Database Cache Dependency
- full parsing of the system cache 7 third-party distributed caching Solutions Memcached and the Cacheman
system cache what What good is it? for a simple example, you want to query some data on a Web page that doesn't change in real time, or that the time of the change is limited. For example, query some historical data. Then every user checks the data is the same. If you do not set the cache, asp.net n Times, This adds to the unnecessary overhead. As a result, it is possible to use the cache in a way that is always faster to return data from memory than to go to the database, thus providing the performance of the application greatly. After all, the memory is very cheap now, and space for time efficiency should be very cost-effective. Especially for long-time, need to set up a network link database query operations. Caching is a very important part of a large web site design. Database-driven web application, if you need to improve its performance, The best approach is to use the caching feature.
System Cache full resolution 1: Overview of the system cache ?
1????? classification of the cache ???? from a distribution perspective, we can summarize the client cache and server-side caching. :
client-Side Caching -- We all have an intuitive impression of this. For example, if you go to a new website, it may take a while for the first time to load the entire page. And then go again, time will be greatly shortened, the reason is that the client cache. Now the browser is more intelligent, it will be on the client machine's hard disk to retain a lot of static files, such as various gif,jpeg files and so on. When you go later, it will try to use the files in the local cache. Only the server-side files are updated, or the files in the cache expire, it will be downloaded again from the server side. Most of the time, IE did this for us. ?
server-Side Caching --? some things can not or should not be in the client cache, then we have to find a way on the server side. Server-side caching in terms of nature, can be divided into two.
- static file caching
many pages are static and rarely changed, so this file is most suitable for static caching. Now theIIS 6.0This part is stored directly in theKernelin memory, by theHTTP. SYSDirect Management. Because it is inKernel Space, so it has a very high performance. If the user's request is inside the cache, thenHTTP. SYSsend content directly toNetworkdrivergo up, don't need to be like before fromIISof theUser Spaceof MemoryCopyto theKerneland then send it toTCP/IP stackon. Kernellevel Cacheis almost now high performanceWeb Serveran essential feature of the.
- Dynamic caching
Dynamic caching is more difficult. Because you should always be aware of the problem when caching, that is, the content of the cache is outdated. Because the content is outdated, there can be serious consequences. For example, websites that buy and sell stocks online. The price you offer to others is out of date, and the other person must cut you off. How caching discovers whether or not you are outdated is a very complex issue.
??? in the ASP , there are several methods for the common dynamic caches: :
? ?? Traditional caching methods
? ?? page Output cache.
? ?? page Local cache.
? ?? Use . NET provided by System.Web.Caching Cache.
? ?? cache dependency.
2? Traditional caching methods
For example, to put reusable things Application or Session to save the.
? session["Style"] = val;
? application["Count"] = 0;
?
?