2022-06-28 分類: 網(wǎng)站建設
空間安裝多個系統(tǒng)時使用,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
' 檢測緩存 緩存名
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
' 設置緩存 緩存名,緩存值
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://jinyejixie.com/news12/172512.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供手機網(wǎng)站建設、關鍵詞優(yōu)化、網(wǎng)頁設計公司、網(wǎng)站制作、靜態(tài)網(wǎng)站、電子商務
聲明:本網(wǎng)站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內容