2022-06-28 分類: 網(wǎng)站建設(shè)
空間安裝多個(gè)系統(tǒng)時(shí)使用,ASP比較常用的緩存函數(shù)技巧
Const WebCacheFlag = "Cache"
' 獲取緩存 緩存名
Function GetCache(ByVal CacheName)
Dim CacheData
CacheName = LCase(ChangeChr(CacheName))
CacheData = Application(WebCacheFlag & CacheName)
If IsArray(CacheData) Then GetCache = CacheData(0) Else GetCache = ""
End Function
' 檢測(cè)緩存 緩存名
Function ChkCache(ByVal CacheName)
Dim CacheData
ChkCache = False
CacheName = LCase(ChangeChr(CacheName))
CacheData = Application(WebCacheFlag & CacheName)
If Not IsArray(CacheData) Then Exit Function
If Not IsDate(CacheData(1)) Then Exit Function
If DateDiff("s", CDate(CacheData(1)), Now()) < 60 * WebCacheTime Then ChkCache = True
End Function
' 設(shè)置緩存 緩存名,緩存值
Function SetCache(ByVal CacheName, ByVal CacheValue)
Dim CacheData
CacheName = LCase(ChangeChr(CacheName))
CacheData = application(WebCacheFlag & CacheName)
If IsArray(CacheData) Then
CacheData(0) = CacheValue
CacheData(1) = Now()
Else
ReDim CacheData(2)
CacheData(0) = CacheValue
CacheData(1) = Now()
End If
Application.Lock
Application(WebCacheFlag & CacheName) = CacheData
Application.UnLock
End Function
網(wǎng)頁名稱:ASP比較常用的緩存函數(shù)技巧
鏈接URL:http://www.rwnh.cn/news12/172512.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供手機(jī)網(wǎng)站建設(shè)、關(guān)鍵詞優(yōu)化、網(wǎng)頁設(shè)計(jì)公司、網(wǎng)站制作、靜態(tài)網(wǎng)站、電子商務(wù)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容