The getcache function automatically creates the required cache.
CopyCode The Code is as follows: function getcache (funsname, isreset, isarr, timeinfo)
'Funsname-content to be cached. Enter a function name here.
'Isreset-whether to update [value: 0 (automatically update when cache is null is determined based on time), 1 (actively update)]
'Isarr -- whether the cached content is a data [0 is a string, 1 is an array]
'Timeinfo -- cache Update time, in seconds. If the value is 0, it is updated only when the cache is empty.
Dim domain = "cnzhaopin.com.cn"
Dim temp_getconfig
Dim re_getcache: re_getcache = false
Dim temp_isarray_type: temp_isarray_type = false
Dim appfunsname: appfunsname = Replace (replace (funsname ,"(",""),")",""),",",".")
If isarr = 1 then temp_isarray_type = true
If isreset = 1 then re_getcache = true
If isreset = 2 then
Execute ("temp_getconfig =" & funsname)
Getcache = temp_getconfig
Exit Function
End if
If application (domain & "_" & appfunsname & "_ time") = "" and timeinfo <> 0 then re_getcache = true
If not re_getcache then
If temp_isarray_type then
If not isarray (Application (domain & "_" & appfunsname) Then re_getcache = true
Else
If application (domain & "_" & appfunsname) = "" then re_getcache = true
End if
End if
If not re_getcache and timeinfo <> 0 then
If int (datediff ("S", application (domain & "_" & appfunsname & "_ time"), now ()> timeinfo then re_getcache = true
End if
If re_getcache then
Execute ("temp_getconfig =" & funsname)
Application. Lock
Application (domain & "_" & appfunsname) = temp_getconfig
Application (domain & "_" & appfunsname & "_ time") = now ()
Application. Unlock
Else
Temp_getconfig = Application (domain & "_" & appfunsname)
End if
Getcache = temp_getconfig
End Function
Use Time:
Copy code The Code is as follows: function output3
Output3 = ""
Set newrs1_conn.exe cute ("select top 60 companyName, comid, vipdata, ishot from company where isok = 1 and vipqx> 60 and vipqx <300 and VIP = 1 and comid in (select comid from jobs where ZT <> 1) Order by newid ()")
Do while not newrs. EOF
Output3 = output3 & "..."
Newrs. movenext
Loop
Newrs. Close
Set newrs = nothing
End Function
Response. Write getcache ("output3", 3600)