List of Object in httpcontext.current.cache

.net, asp.net, caching, httpcontext, vb.net

Solution

Yes, you can either index based on the cache key, or you you can iterate over the contents:

For Each c In Cache
    ' Do something with c
Next
' Pardon  my VB syntax if it's wrong

Problem

Is there a way to look through the cache for all objects in the cache? I'm dynamically creating objects and I need to periodically go through the list to purge out objects I'm no longer using.

Original source