Changes all instances of the legacy Cache class to be using ApplicationContext.Current.ApplicationCache.

Fixes: #U4-2039 - ensures macro xslt cache is invalidated in LB scenarios.
This commit is contained in:
Shannon Deminick
2013-04-03 23:39:51 +06:00
parent e14d3fd379
commit 2a7e493c74
9 changed files with 76 additions and 54 deletions

View File

@@ -273,6 +273,30 @@ namespace Umbraco.Core
}
}
/// <summary>
/// Gets (and adds if necessary) an item from the cache
/// </summary>
/// <typeparam name="TT"></typeparam>
/// <param name="cacheKey"></param>
/// <param name="priority"></param>
/// <param name="cacheDependency"></param>
/// <param name="getCacheItem"></param>
/// <returns></returns>
public TT GetCacheItem<TT>(string cacheKey,
CacheItemPriority priority,
CacheDependency cacheDependency,
Func<TT> getCacheItem)
{
if (!_enableCache)
{
return _nullCache.GetCacheItem<TT>(cacheKey, priority, null, cacheDependency, null, getCacheItem);
}
else
{
return _httpCache.GetCacheItem<TT>(cacheKey, priority, null, cacheDependency, null, getCacheItem);
}
}
/// <summary>
/// Inserts an item into the cache, if it already exists in the cache it will be replaced
/// </summary>