是否有办法清除或重置整个网站的输出缓存而不重新启动?
我刚刚开始在一个网站上使用输出缓存,当我在设置它时出错时,我需要一个我可以浏览的页面,它会重置它。
发布于 2018-07-27 17:09:47
将下列代码添加到控制器或页代码中:
HttpContext.Cache.Insert("Page", 1);
Response.AddCacheItemDependency("Page");
若要清除输出,请在控制器中使用以下命令:
HttpContext.Cache.Remove("Page");
发布于 2018-07-27 18:31:07
这应该能起作用:
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
https://stackoverflow.com/questions/-100000442
复制相似问题