1

I'm trying to remove a specific item from the ASP.NET Cache in order to force a reload. Something like this:

System.Web.HttpContext.Current.Cache.Remove(SomeKey);

But then I check it immediately afterward, and Cache[SomeKey] is NOT null. It still contains a reference to this item I want to clear. Am I missing something obvious here?

Bryan
  • 8,748
  • 7
  • 41
  • 62
  • When you inserted the item, did you specify a [CacheItemRemovedCallback](http://msdn.microsoft.com/en-us/library/system.web.caching.cacheitemremovedcallback%28v=VS.100%29.aspx)? If so, what does it do? – Dean Harding Jun 04 '10 at 00:57

1 Answers1

0

OK, I figured it out... turns out I had a property in my Watch debug window, which had a side effect of priming the cache. So even though I was looking at the Cache object it was actually being instantly updated with a new value every time it was cleared. Embarrassing.

Bryan
  • 8,748
  • 7
  • 41
  • 62