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

Bri*_*ght 10 asp.net outputcache

有没有方法清除或重置整个网站的outputcache而不重启?

我刚开始在网站上使用outputcache,当我在设置时出错时,我需要一个可以浏览的页面来重置它.

Eth*_*son 9

这应该做的伎俩:

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
Run Code Online (Sandbox Code Playgroud)

  • 这个答案实际上并没有清除原始问题中指定的"整个网站"的缓存. (5认同)