问题
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