Merge pull request #1960 from umbraco/temp-u4-9936

U4-9936 - fix xml cache refresh in lb
This commit is contained in:
Shannon Deminick
2017-05-24 16:15:03 +10:00
committed by GitHub
2 changed files with 5 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ namespace Umbraco.Web.Cache
/// <remarks>
/// If Load balancing is enabled (by default disabled, is set in umbracoSettings.config) PageCacheRefresher will be called
/// everytime content is added/updated/removed to ensure that the content cache is identical on all load balanced servers
/// </remarks>
/// </remarks>
public class PageCacheRefresher : TypedCacheRefresherBase<PageCacheRefresher, IContent>
{
@@ -51,6 +51,7 @@ namespace Umbraco.Web.Cache
public override void RefreshAll()
{
content.Instance.RefreshContentFromDatabase();
XmlPublishedContent.ClearRequest();
base.RefreshAll();
}
@@ -62,6 +63,7 @@ namespace Umbraco.Web.Cache
{
ApplicationContext.Current.ApplicationCache.ClearPartialViewCache();
content.Instance.UpdateDocumentCache(id);
XmlPublishedContent.ClearRequest();
DistributedCache.Instance.ClearAllMacroCacheOnCurrentServer();
DistributedCache.Instance.ClearXsltCacheOnCurrentServer();
base.Refresh(id);
@@ -75,6 +77,7 @@ namespace Umbraco.Web.Cache
{
ApplicationContext.Current.ApplicationCache.ClearPartialViewCache();
content.Instance.ClearDocumentCache(id, false);
XmlPublishedContent.ClearRequest();
DistributedCache.Instance.ClearAllMacroCacheOnCurrentServer();
DistributedCache.Instance.ClearXsltCacheOnCurrentServer();
ClearAllIsolatedCacheByEntityType<PublicAccessEntry>();

View File

@@ -511,7 +511,7 @@ namespace umbraco
private void ClearContextCache()
{
var items = HttpContextItems;
if (items == null || items.Contains(XmlContextContentItemKey)) return;
if (items == null || items.Contains(XmlContextContentItemKey) == false) return;
items.Remove(XmlContextContentItemKey);
}