changes all instances accessing cache by key "contentItem" to use CacheKeys.ContentItemCache and replaces

all of it's cache usages with the ApplicationContext.Current.ApplicationCache. Obsoletes a couple of methods
that are not used.
This commit is contained in:
Shannon Deminick
2013-04-03 22:34:40 +06:00
parent 23525300bb
commit e14d3fd379
8 changed files with 77 additions and 40 deletions

View File

@@ -272,6 +272,27 @@ namespace Umbraco.Core
return _httpCache.GetCacheItem<TT>(cacheKey, priority, refreshAction, cacheDependency, timeout, getCacheItem);
}
}
/// <summary>
/// Inserts an item into the cache, if it already exists in the cache it will be replaced
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="cacheKey"></param>
/// <param name="priority"></param>
/// <param name="getCacheItem"></param>
public void InsertCacheItem<T>(string cacheKey,
CacheItemPriority priority,
Func<T> getCacheItem)
{
if (!_enableCache)
{
_nullCache.InsertCacheItem<T>(cacheKey, priority, getCacheItem);
}
else
{
_httpCache.InsertCacheItem<T>(cacheKey, priority, getCacheItem);
}
}
/// <summary>
/// Inserts an item into the cache, if it already exists in the cache it will be replaced