如何清理asp站点缓存的代码
?<%
Call RemoveAllCache()
Sub RemoveAllCache()
Dim cachelist,i
Call InnerHtml("UpdateInfo","<b>開始執行清理當前站點緩存</b>:")
Cachelist=split(GetallCache(),",")
If UBound(cachelist)>1 Then
For i=0 to UBound(cachelist)-1
DelCahe Cachelist(i)
Call InnerHtml("UpdateInfo","更新 <b>"&cachelist(i)&"</b> 完成")
Next
Call InnerHtml("UpdateInfo","更新了"& UBound(cachelist)-1 &"個緩存對象<br>")
Else
Call InnerHtml("UpdateInfo","<b>當前站點全部緩存清理完成。</b>。")
End If
End Sub
Function GetallCache()
Dim Cacheobj
For Each Cacheobj in Application.Contents
GetallCache = GetallCache & Cacheobj & ","
Next
End Function
Sub DelCahe(MyCaheName)
Application.Lock
Application.Contents.Remove(MyCaheName)
Application.unLock
End Sub
Sub InnerHtml(obj,msg)
Response.Write "<li>"&msg&"</li>"
Response.Flush
End Sub
%>?
總結
以上是生活随笔為你收集整理的如何清理asp站点缓存的代码的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 黑莓blackberry手机刷ROM 的
- 下一篇: 简易ASP文件缓存技术