开发者

Why is my cache item not nulled after Cache.Remove call?

开发者 https://www.devze.com 2023-01-02 00:05 出处:网络
I\'m trying to remove a specific item from the ASP.NET Cache in order to force a reload.Something like 开发者_JAVA百科this:

I'm trying to remove a specific item from the ASP.NET Cache in order to force a reload. Something like 开发者_JAVA百科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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消