Web.Cache - add notes to cache refreshers re. dependencies

This commit is contained in:
Stephan
2013-03-31 18:40:55 -02:00
parent 6d18d32356
commit ad52c0f033
2 changed files with 14 additions and 7 deletions

View File

@@ -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();
}
}
}
}

View File

@@ -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();
}
}
}
}