// only used by providers
private static void DependencyRemovedCallback(string key, object value, CacheItemRemovedReason reason)
{
Debug.Trace("OutputCache", "DependencyRemovedCallback: reason=" + reason + ", key=" + key);
DependencyCacheEntry dce = value as DependencyCacheEntry;
if (dce.KernelCacheEntryKey != null)
{
// invalidate kernel cache entry
if (HttpRuntime.UseIntegratedPipeline)
{
UnsafeIISMethods.MgdFlushKernelCache(dce.KernelCacheEntryKey);
}
else
{
UnsafeNativeMethods.InvalidateKernelCache(dce.KernelCacheEntryKey);
}
}
if (reason == CacheItemRemovedReason.DependencyChanged)
{
if (dce.OutputCacheEntryKey != null)
{
try {
OutputCache.RemoveFromProvider(dce.OutputCacheEntryKey, dce.ProviderName);
}
catch (Exception e) {
HandleErrorWithoutContext(e);
}
}
}
}