From ad52c0f033dda261b2c1767cd3b4e7d5a33057c1 Mon Sep 17 00:00:00 2001 From: Stephan Date: Sun, 31 Mar 2013 18:40:55 -0200 Subject: [PATCH] Web.Cache - add notes to cache refreshers re. dependencies --- src/Umbraco.Web/Cache/ContentTypeCacheRefresher.cs | 11 +++++++---- src/Umbraco.Web/Cache/DomainCacheRefresher.cs | 10 +++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web/Cache/ContentTypeCacheRefresher.cs b/src/Umbraco.Web/Cache/ContentTypeCacheRefresher.cs index 0e31bf0bc3..6fac44e2cb 100644 --- a/src/Umbraco.Web/Cache/ContentTypeCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/ContentTypeCacheRefresher.cs @@ -209,12 +209,15 @@ namespace Umbraco.Web.Cache if (payloads.Any(x => x.Type == typeof(IContentType).Name) && !payloads.All(x => x.IsNew)) //if they are all new then don't proceed { - //we need to clear the routes cache here! - var contentCache = PublishedContentCacheResolver.Current.ContentCache as PublishedContentCache; + // SD: we need to clear the routes cache here! + // + // zpqrtbnk: no, not here, in fact the caches should subsribe to refresh events else we + // 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; if (contentCache != null) - { contentCache.RoutesCache.Clear(); - } } } } diff --git a/src/Umbraco.Web/Cache/DomainCacheRefresher.cs b/src/Umbraco.Web/Cache/DomainCacheRefresher.cs index 3de428658f..c08d2f37a7 100644 --- a/src/Umbraco.Web/Cache/DomainCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/DomainCacheRefresher.cs @@ -41,12 +41,16 @@ namespace Umbraco.Web.Cache private void ClearCache() { ApplicationContext.Current.ApplicationCache.ClearCacheItem(CacheKeys.DomainCacheKey); - //we need to clear the routes cache here! + + // SD: we need to clear the routes cache here! + // + // zpqrtbnk: no, not here, in fact the caches should subsribe to refresh events else we + // are creating a nasty dependency - but keep it like that for the time being while + // SD is cleaning cache refreshers up. + var contentCache = PublishedContentCacheResolver.Current.ContentCache as PublishedContentCache; if (contentCache != null) - { contentCache.RoutesCache.Clear(); - } } } } \ No newline at end of file