public static void RemoveOutputCacheItem (string path)
{
if (path == null)
throw new ArgumentNullException ("path");
if (path.Length == 0)
return;
if (path [0] != '/')
throw new ArgumentException ("'" + path + "' is not an absolute virtual path.");
#if NET_4_0
RemoveOutputCacheItem (path, OutputCache.DefaultProviderName);
#else
HttpContext context = HttpContext.Current;
HttpApplication app_instance = context != null ? context.ApplicationInstance : null;
HttpModuleCollection modules = app_instance != null ? app_instance.Modules : null;
OutputCacheModule ocm = modules != null ? modules.Get ("OutputCache") as OutputCacheModule : null;
OutputCacheProvider internalProvider = ocm != null ? ocm.InternalProvider : null;
if (internalProvider == null)
return;
internalProvider.Remove (path);
#endif
}