如何在不重新启动应用程序的情况下清除网站的OutputCache

时间:2020-03-05 18:45:44  来源:igfitidea点击:

有没有一种方法可以清除或者重置整个网站的输出缓存而无需重新启动?

我只是开始在网站上使用outputcache,当我在设置它时出错时,我需要一个页面,我可以浏览该页面将其重置。

解决方案

回答

这应该可以解决问题:

Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)

 Dim path As String
 path="/AbosoluteVirtualPath/OutputCached.aspx"
 HttpResponse.RemoveOutputCacheItem(path)

End Sub