I have to maintain an old asp.net application, and need to disable all access to the Cache object for debugging purposes. There are hundreds of pages that use the structure:
if (Cache["myobject"] != null)
{
//get data from the cache
//...
}
else
{
//go to the DB, load the cache and send it to the client
}
I know I should refactor this code but, in the meantime, do you know of any simple and centralized way to empty (or disable) the Cache object?