asp开发应用缓存cache技术讲解(2)
以下为引用的内容: getcache.asp <% Const CACHE_DEFAULT_INTERVAL = 30 '每隔30秒刷新一次cache Dim HTMLStream Dim IsExpires IsExpires = CacheExpires Function CacheExpires Dim strLastupdate Dim result strLastupdate = Application("Lastupdate") If (strLastupdate = "") Or (CACHE_DEFAULT_INTERVAL < DateDiff("s", strLastupdate, Now)) Then result = true SetLastupdateTime Else result = false End If CacheExpires = result End Function
Sub SetLastupdateTime |
以下为引用的内容: Sub updateHTMLStream dim d d = FetchHTMLStream Application.Lock Application("CACHE_HTMLStream") = d Application.UnLock End Sub
Function FetchHTMLStream |
- 上一篇:ASP跳出循环进入下一次循环的方法
- 下一篇:ASP获取服务器信息检测源码