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

3

5

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.

Mortician answered 26/2, 2010 at 17:20 Comment(0)
D
2

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

Dutiful answered 26/2, 2010 at 19:35 Comment(0)
P
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

Prominent answered 27/2, 2010 at 1:16 Comment(3)
Useful tool! I went with zihotki's answer because I really wanted to see how to do it and your source code isn't currently available, but thanks.Mortician
@Mark B Thanks! Yeah I am not sure where I put the source code. It just vanished! :(Prominent
Here's a working link: github.com/azamsharp/WIYC. I've confirmed it works on ASP.NET 4.0 if you compile WIYCLibrary and then edit Web.config to add the HTTP handler (as specified in WebDriver\Web.config)Cleocleobulus
A
0

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

Aggiornamento answered 7/10, 2014 at 21:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.