diff --git a/src/Umbraco.Web/Cache/ContentTypeCacheRefresher.cs b/src/Umbraco.Web/Cache/ContentTypeCacheRefresher.cs index 6fac44e2cb..46e8b91371 100644 --- a/src/Umbraco.Web/Cache/ContentTypeCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/ContentTypeCacheRefresher.cs @@ -215,7 +215,7 @@ namespace Umbraco.Web.Cache // are creating a nasty dependency - but keep it like that for the time being while // SD is cleaning cache refreshers up. - var contentCache = PublishedCachesResolver.Current.Caches.ContentCache as PublishedContentCache; + var contentCache = UmbracoContext.Current.ContentCache.InnerCache as PublishedContentCache; if (contentCache != null) contentCache.RoutesCache.Clear(); } diff --git a/src/Umbraco.Web/Cache/DomainCacheRefresher.cs b/src/Umbraco.Web/Cache/DomainCacheRefresher.cs index 27a8a70eda..3d998ae718 100644 --- a/src/Umbraco.Web/Cache/DomainCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/DomainCacheRefresher.cs @@ -48,7 +48,7 @@ namespace Umbraco.Web.Cache // are creating a nasty dependency - but keep it like that for the time being while // SD is cleaning cache refreshers up. - var contentCache = PublishedCachesResolver.Current.Caches.ContentCache as PublishedContentCache; + var contentCache = UmbracoContext.Current.ContentCache.InnerCache as PublishedContentCache; if (contentCache != null) contentCache.RoutesCache.Clear(); } diff --git a/src/Umbraco.Web/PublishedCache/IPublishedCaches.cs b/src/Umbraco.Web/PublishedCache/IPublishedCaches.cs index 3125656c79..82609b7457 100644 --- a/src/Umbraco.Web/PublishedCache/IPublishedCaches.cs +++ b/src/Umbraco.Web/PublishedCache/IPublishedCaches.cs @@ -11,16 +11,6 @@ namespace Umbraco.Web.PublishedCache /// Groups caches that _may_ be related. interface IPublishedCaches { - /// - /// Gets the content cache. - /// - IPublishedContentCache ContentCache { get; } - - /// - /// Gets the media cache. - /// - IPublishedMediaCache MediaCache { get; } - /// /// Creates a contextual content cache for a specified context. /// diff --git a/src/Umbraco.Web/PublishedCache/PublishedCaches.cs b/src/Umbraco.Web/PublishedCache/PublishedCaches.cs index 7aa7e2f501..287cd740e6 100644 --- a/src/Umbraco.Web/PublishedCache/PublishedCaches.cs +++ b/src/Umbraco.Web/PublishedCache/PublishedCaches.cs @@ -6,26 +6,19 @@ /// Default implementation for unrelated caches. class PublishedCaches : IPublishedCaches { + private readonly IPublishedContentCache _contentCache; + private readonly IPublishedMediaCache _mediaCache; + /// /// Initializes a new instance of the class with a content cache /// and a media cache. /// public PublishedCaches(IPublishedContentCache contentCache, IPublishedMediaCache mediaCache) { - ContentCache = contentCache; - MediaCache = mediaCache; + _contentCache = contentCache; + _mediaCache = mediaCache; } - /// - /// Gets the content cache. - /// - public IPublishedContentCache ContentCache { get; private set; } - - /// - /// Gets the media cache. - /// - public IPublishedMediaCache MediaCache { get; private set; } - /// /// Creates a contextual content cache for a specified context. /// @@ -33,7 +26,7 @@ /// A new contextual content cache for the specified context. public ContextualPublishedContentCache CreateContextualContentCache(UmbracoContext context) { - return new ContextualPublishedContentCache(ContentCache, context); + return new ContextualPublishedContentCache(_contentCache, context); } /// @@ -43,7 +36,7 @@ /// A new contextual media cache for the specified context. public ContextualPublishedMediaCache CreateContextualMediaCache(UmbracoContext context) { - return new ContextualPublishedMediaCache(MediaCache, context); + return new ContextualPublishedMediaCache(_mediaCache, context); } } }