diff --git a/src/Umbraco.Web/Cache/PageCacheRefresher.cs b/src/Umbraco.Web/Cache/PageCacheRefresher.cs index a8e24009fb..75118a6748 100644 --- a/src/Umbraco.Web/Cache/PageCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/PageCacheRefresher.cs @@ -5,6 +5,7 @@ using Umbraco.Core.Models; using Umbraco.Core.Sync; using umbraco; using umbraco.cms.businesslogic.web; +using Umbraco.Web.PublishedCache.XmlPublishedCache; namespace Umbraco.Web.Cache { @@ -84,6 +85,7 @@ namespace Umbraco.Web.Cache { ApplicationContext.Current.ApplicationCache.ClearPartialViewCache(); content.Instance.UpdateDocumentCache(new Document(instance)); + XmlPublishedContent.ClearRequest(); DistributedCache.Instance.ClearAllMacroCacheOnCurrentServer(); DistributedCache.Instance.ClearXsltCacheOnCurrentServer(); ClearAllIsolatedCacheByEntityType(); @@ -94,6 +96,7 @@ namespace Umbraco.Web.Cache { ApplicationContext.Current.ApplicationCache.ClearPartialViewCache(); content.Instance.ClearDocumentCache(new Document(instance)); + XmlPublishedContent.ClearRequest(); DistributedCache.Instance.ClearAllMacroCacheOnCurrentServer(); DistributedCache.Instance.ClearXsltCacheOnCurrentServer(); ClearAllIsolatedCacheByEntityType(); diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedContent.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedContent.cs index ca7c28dc7e..6d7864b874 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedContent.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedContent.cs @@ -444,8 +444,15 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache var id = attrs == null ? null : attrs.GetNamedItem("id").Value; if (id.IsNullOrWhiteSpace()) throw new InvalidOperationException("Node has no ID attribute."); var cache = ApplicationContext.Current.ApplicationCache.RequestCache; - var key = "XMLPUBLISHEDCONTENT_" + id; // dont bother with preview, wont change during request in v7 + var key = CacheKeyPrefix + id; // dont bother with preview, wont change during request in v7 return (IPublishedContent) cache.GetCacheItem(key, () => (new XmlPublishedContent(node, isPreviewing)).CreateModel()); } - } + + public static void ClearRequest() + { + ApplicationContext.Current.ApplicationCache.RequestCache.ClearCacheByKeySearch(CacheKeyPrefix); + } + + private const string CacheKeyPrefix = "CONTENTCACHE_XMLPUBLISHEDCONTENT_"; + } } \ No newline at end of file