一区二区三区在线-一区二区三区亚洲视频-一区二区三区亚洲-一区二区三区午夜-一区二区三区四区在线视频-一区二区三区四区在线免费观看

服務器之家:專注于服務器技術及軟件下載分享
分類導航

PHP教程|ASP.NET教程|Java教程|ASP教程|編程技術|正則表達式|C/C++|IOS|C#|Swift|Android|VB|R語言|JavaScript|易語言|vb.net|

服務器之家 - 編程語言 - ASP教程 - asp自帶的內存緩存 application

asp自帶的內存緩存 application

2019-09-06 11:45服務器之家 ASP教程

asp強大的application 是 php 中所沒有的。昨天朋友抱怨他的人才網站讀取速度慢,于是我幫他把asp中讀庫比較費時的部分用application做了緩存。

函數getcache,會自動建立需要的緩存。 

復制代碼代碼如下:


Function getcache(funsname,isreset,isarr,timeinfo) 
‘funsname — 需要緩存的內容,這里要輸入一個function名 
‘isreset –是否更新[值:0(根據時間或判斷緩存為空時自動更新)、1(主動更新)] 
‘ isarr —- 所緩存的內容是否為一個數據[0為字符串,1為數組] 
‘ timeinfo —- 緩存更新時間,單位為秒,當值為0時,則只在緩存為空時,才更新 
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(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 



使用時: 

復制代碼代碼如下:


Function output3 
output3=”" 
set newrs=conn.execute(”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″,0,0,3600) 

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 亚洲高清国产拍精品影院 | 91精品国产高清久久久久久 | 99re这里只有精品在线观看 | 国产日韩欧美精品在线 | 午夜国产福利视频一区 | 亚洲欧美久久久久久久久久爽网站 | 日本剧情片在线播放中文版 | 久久久无码精品亚洲A片软件 | 欧美性一区二区三区 | 高清在线看 | 亚洲无人区乱码中文字幕 | 大香人蕉免费视频75 | 欧美女孩videos | 免费一区二区视频 | 媳妇和公公小说 | 日韩日b视频 | 色鬼网| 无限好资源第一片免费韩国 | 日本伦理动漫在线观看 | 亚洲 欧美 国产 日韩 字幕 | 性鸥美 | 亚洲国产精品久久网午夜 | 亚洲欧美在线观看首页 | 免费观看欧美一级高清 | 国产一区二区三区久久精品 | 国产一区二区视频在线播放 | 国产老熟 | 精品AV亚洲乱码一区二区 | 美女和男人免费网站视频 | 国产在线精品一区二区高清不卡 | 啊好爽视频 | 精品国产一区二区在线观看 | 日本妇人成熟免费观看18 | 国产清纯91天堂在线观看 | 97色伦在线观看 | 成人免费体验区福利云点播 | 91制片厂制作果冻传媒八夷 | 好大好猛好深好爽视频 | 2019天天干夜夜操 | 免费黄色网站视频 | 欧美日韩在线观看精品 |