From 61c52913dd2c88238f39dac4ff54fd7557112d96 Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 28 Aug 2018 16:50:56 +1000 Subject: [PATCH] Fixes MediaCacheRefresher, it wasn't checking if there was an IMedia cache --- src/Umbraco.Web/Cache/MediaCacheRefresher.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/Cache/MediaCacheRefresher.cs b/src/Umbraco.Web/Cache/MediaCacheRefresher.cs index 7c64f3378b..4abf7d8787 100644 --- a/src/Umbraco.Web/Cache/MediaCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/MediaCacheRefresher.cs @@ -47,15 +47,17 @@ namespace Umbraco.Web.Cache if (anythingChanged) { - var mediaCache = CacheHelper.IsolatedRuntimeCache.GetCache(); - Current.ApplicationCache.ClearPartialViewCache(); + var mediaCache = CacheHelper.IsolatedRuntimeCache.GetCache(); + foreach (var payload in payloads) { if (payload.ChangeTypes == TreeChangeTypes.Remove) _idkMap.ClearCache(payload.Id); + if (!mediaCache) continue; + // repository cache // it *was* done for each pathId but really that does not make sense // only need to do it for the current media