Using the cache technology in ASP can largely improve your website performance. In fact, these implementation methods are very simple. It will explain how the cache on the server is how to work ADO connection technology.
Before introducing these technologies, let's explain what is the cache technology of ASP.
The so -called cache is actually opening a space to save data in memory. Using the cache, you do n’t need to visit the data you stored on the hard disk. Flexible use of the cache. The torture when reading data. Once you perform a query action and put the query results into the cache, you can quickly visit the data quickly. And if you do not put the data into the cache, when you execute this query again, the server consumes the process from the database and sorted it.
When the data is stored in the cache, the time it takes when querying again is mainly at the time of displaying the data.
In other words, we should not put the data that often needs to change into the cache of the server. We should change less, but we need to put the data that we often access into the cache.
Now we first discuss the technique of using ASP on the server. After that, we will discuss how ASP uses on the client
Cache technology.
When you have a lot of data (static, that is, less changes) need to be displayed to the client, you can consider using the cache technology on the server. This technology is particularly suitable for those websites with strong display style consistency (huh, for non -mainstream websites, it is not easy to use.)
In fact, the implementation method is particularly simple. Just look at the following simple example.
This is an example for displaying books classification
Displaybooks.asp file:
< %@ Language = javascript %>
<html>
<body>
<FORM METHOD = Post>
Book classification; < % = getBookslistbox () %>
<p>
<input type = submit>
< %
Function GetbooksListbox () ()
{{
Bookslistbox = Application (Bookslistbox)
if (bookslistbox! = Null) Return Bookslistbox;
Crlf = String.fromCharcode (13, 10)
Bookslistbox = <select name = books> + crlf;
SQL = Select * from Books Order by name;
cnnbooks = server.createObject (adodb.connection);
cnnbooks.open (books, admin,);
rstbooks = cnnbooks.execute (SQL);
FLDBOOKNAME = RSTBOOKS (BookName);
While (! rstbooks.eof) {
BOOKSLISTBOX = BOOKSLISTBOX + <option> +
FLDBOOKNAME + + CRLF;
rstbooks.movenext ();
}
Bookslistbox = Bookslistbox +
Application (bookslistbox) = bookslistbox
Return BookslistBox;
}
%>