我正在编写代码以从非 Azure AppFabric (v1.1) 中删除缓存条目。在下面的代码片段中,DataCache.Remove 总是返回 false...
object bogusData = new object();
_cache.Put(account, bogusData, TimeSpan.FromSeconds(10.0));
Sleep(1000); // for testing purposes
// we don't need the contents of the cache entry, we just want to know
// if the account is in the cache or not...
object cachedData = _cache.Get(account);
// if we don't find it in the cache, it is already been removed (or expired), so return true.
if (cachedData == null)
return true;
Sleep(1000); // for testing purposes
// this always returns false
bool status = _cache.Remove(account);
按照设计,在上面的代码片段中,cachedData 始终为 != null。
有任何想法吗?