How can I view the contents of the ASP.NET OutputCache?

随声附和 提交于 2019-12-06 03:51:23

问题


Is there any way that I can list the pages which are currently stored in the OutputCache?

Just a list of paths would do, but if there's a way to get more information about each item (expiry etc), then all the better.


回答1:


As far as I remember Cache is a singleton and there is only one instance of it per app domain. OutputCache uses it too and it's nothing more than just a Response.Cache. So I think cached pages should be available through the Cache (Sorry, I can't check this at the moment). And the following articles should help you in this case:
http://www.codeproject.com/KB/session/exploresessionandcache.aspx
http://aspalliance.com/CacheManager/Default.aspx




回答2:


Here is a little tool I wrote that will let you to view the contents of your Cache. You can also view the dependencies on a file and remove the cache.

https://github.com/azamsharp/WIYC




回答3:


Here is another tool that displays the Usercontrol(Webforms) cache and am extending that to display the outputcache details as well

https://github.com/chandarmk/InternalCacheHandler



来源:https://stackoverflow.com/questions/2343462/how-can-i-view-the-contents-of-the-asp-net-outputcache

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!