The ASP has been released since released, and the use of ASP technology is quite mature. Since Microsoft launched ASP.NET, it gradually stopped updates to the ASP version. However, because many people are still used to using ASP to develop websites, I will again explain how to use Cache in ASP again. Simply put the basic principle of using Cache is to continuously save a certain period of time in memory in memory, to provide direct access to it. For example, some data need to be obtained from multiple tables in multiple tables, and almost every page needs to call these data. The best implementation in this case is to bring this part of the data Cache, and the simple implementation of the ASP is to encapsulate the final expression of these data (eg HTML flow) in the string and store it in the ASP built-in object Application (mainly The discussion is dynamic cache, and simple ASP applications are omitted). The advantage of this is that this HTML can be called globally over the entire website, and Application is in memory, so you don't have to query the database, thus speeding up the response time and saving server load. Of course, this is an example of a typical empty time for consumption.
Although there are many benefits, it is no longer applicable when there is a frequently changing data source (database), because the ASP Application object has a disadvantage, that is, it is not possible to automatically change with the data source. Change, or control the refresh interval. So developers need to program the dynamic cache. Of course, when the program is designed, you can update the AppLiction when all changes in the data source (database) operation. Thereby, the data source (database) is always consistent. Doing this will be more considered on programming, it is easy to miss the details. So I don't recommend this method in addition to a particular situation.
I think the best way in ASP is to use programmatically refresh Cache, which means that sets an expiration time stored in the Application. Of course, the Application object does not have such an ExpiRetime property in the ASP. This requires the implementation of the program.
Code asp: default.asp
<% @ Language = vbscript%> <% option expedition%> <% response.buffer = true%>