Frog recommendation: simulate cache in. net in asp
Source: Internet
Author: User
<! --
To improve the performance of the homepage, whenever the homepage needs to call the database to display data, it first tries to call data from the cache,
If no data is available in the cache, enable the database to retrieve the record set. To synchronize the data displayed on the page with the database within a certain period of time,
We set the cache expiration time to 30 seconds.
Statement: The cache management class comes from Forum 7.0.
Note: it is best not to directly cache stateful objects and MTA-mode objects in the cache, such as directly cache record sets or database linked objects.
-->
<%
Sub ShowRsArr (rsArr)
'2017-1-27 by Frog Prince
'Use a table to display the table structure of the array generated by the record set getrows.
'
Response. Write "<table width = 100% border = 0 cellspacing = 0 cellpadding = 0>"
If Not IsEmpty (rsArr) Then
For y = 0 To Ubound (rsArr, 2)
Response. Write "<tr>"
For x = 0 to Ubound (rsArr, 1)
Response. Write "<td>" & rsArr (x, y) & "</td>"
Next
Response. Write "</tr>"
Next
Else
Response. Write "<tr>"
Response. Write "<td colspan =" & rs. fields. count-1 & "> No Records </td>"
Response. Write "</tr>"
End If
Response. Write "</table>"
End Sub
Class Cls_Cache
Rem ============================= instructions ========================================================== ======================================
Rem = this category of modules is original to the mobile network pioneer, author: Lost City prodigal son. If this class module is used, do not remove this description. This annotation does not affect the execution speed. =
Rem = role: cache and cache management =
Rem = Public variable: Reloadtime Expiration Time (in minutes) default value: 14400, =
Rem = the maximum value of the MaxCount cached object. If the value exceeds the maximum value, objects that are used less frequently are automatically deleted. The default value is 300 =
Rem = the total name of the CacheName cache group. The default value is "Dvbbs". If a site contains more than one cache group, you need to change this value externally.
=
Rem = attribute: Name defines the Name of the cache object and only writes the attribute.
=
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.