More renaming of caches

This commit is contained in:
Stephan
2019-01-18 08:14:08 +01:00
parent 5aba1a6bd2
commit f952fe7aeb
27 changed files with 178 additions and 193 deletions

View File

@@ -43,15 +43,15 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
private readonly IEntityXmlSerializer _entitySerializer;
// must be specified by the ctor
private readonly IAppCache _cacheProvider;
private readonly IAppCache _appCache;
public PublishedMediaCache(XmlStore xmlStore, IMediaService mediaService, IUserService userService, IAppCache cacheProvider, PublishedContentTypeCache contentTypeCache, IEntityXmlSerializer entitySerializer)
public PublishedMediaCache(XmlStore xmlStore, IMediaService mediaService, IUserService userService, IAppCache appCache, PublishedContentTypeCache contentTypeCache, IEntityXmlSerializer entitySerializer)
: base(false)
{
_mediaService = mediaService ?? throw new ArgumentNullException(nameof(mediaService));
_userService = userService ?? throw new ArgumentNullException(nameof(userService));
_cacheProvider = cacheProvider;
_appCache = appCache;
_xmlStore = xmlStore;
_contentTypeCache = contentTypeCache;
_entitySerializer = entitySerializer;
@@ -63,16 +63,16 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
/// <param name="mediaService"></param>
/// <param name="userService"></param>
/// <param name="searchProvider"></param>
/// <param name="cacheProvider"></param>
/// <param name="appCache"></param>
/// <param name="contentTypeCache"></param>
/// <param name="entitySerializer"></param>
internal PublishedMediaCache(IMediaService mediaService, IUserService userService, ISearcher searchProvider, IAppCache cacheProvider, PublishedContentTypeCache contentTypeCache, IEntityXmlSerializer entitySerializer)
internal PublishedMediaCache(IMediaService mediaService, IUserService userService, ISearcher searchProvider, IAppCache appCache, PublishedContentTypeCache contentTypeCache, IEntityXmlSerializer entitySerializer)
: base(false)
{
_mediaService = mediaService ?? throw new ArgumentNullException(nameof(mediaService));
_userService = userService ?? throw new ArgumentNullException(nameof(userService));
_searchProvider = searchProvider ?? throw new ArgumentNullException(nameof(searchProvider));
_cacheProvider = cacheProvider;
_appCache = appCache;
_contentTypeCache = contentTypeCache;
_entitySerializer = entitySerializer;
}
@@ -598,8 +598,8 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
// clear recursive properties cached by XmlPublishedContent.GetProperty
// assume that nothing else is going to cache IPublishedProperty items (else would need to do ByKeySearch)
// NOTE all properties cleared when clearing the content cache (see content cache)
//_cacheProvider.ClearCacheObjectTypes<IPublishedProperty>();
//_cacheProvider.ClearCacheByKeySearch("XmlPublishedCache.PublishedMediaCache:RecursiveProperty-");
//_appCache.ClearCacheObjectTypes<IPublishedProperty>();
//_appCache.ClearCacheByKeySearch("XmlPublishedCache.PublishedMediaCache:RecursiveProperty-");
}
#region Content types
@@ -663,7 +663,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
parentId => parentId < 0 ? null : GetUmbracoMedia(parentId),
GetChildrenMedia,
GetProperty,
_cacheProvider,
_appCache,
_contentTypeCache,
cacheValues.XPath, // though, outside of tests, that should be null
cacheValues.FromExamine
@@ -676,14 +676,14 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
if (_publishedMediaCacheEnabled == false)
return func(id);
var cache = Current.ApplicationCache.RuntimeCache;
var cache = Current.AppCaches.RuntimeCache;
var key = PublishedMediaCacheKey + id;
return (CacheValues)cache.Get(key, () => func(id), _publishedMediaCacheTimespan);
}
internal static void ClearCache(int id)
{
var cache = Current.ApplicationCache.RuntimeCache;
var cache = Current.AppCaches.RuntimeCache;
var sid = id.ToString();
var key = PublishedMediaCacheKey + sid;