updates more cache handling, fixes syntax error in examineindex.release.config, fixes the DefaultServerMessenger ctor

to be lazy since the db context isn't initialized yet (will speed up start a bit too), ensures that the macro/xslt caching
clearing is only done on the single server instead or re-posing another distributed call.
This commit is contained in:
Shannon Deminick
2013-03-16 01:37:05 +06:00
parent 07bdd138cc
commit 2dea4a1d70
14 changed files with 140 additions and 60 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Models;
using umbraco;
@@ -210,12 +211,21 @@ namespace Umbraco.Web.Cache
}
/// <summary>
/// Clears the cache for all macros
/// Clears the cache for all macros on the current server
/// </summary>
/// <param name="dc"></param>
public static void ClearAllMacroCache(this DistributedCache dc)
public static void ClearAllMacroCacheOnCurrentServer(this DistributedCache dc)
{
dc.RefreshAll(new Guid(DistributedCache.MacroCacheRefresherId));
//NOTE: The 'false' ensure that it will only refresh on the current server, not post to all servers
dc.RefreshAll(new Guid(DistributedCache.MacroCacheRefresherId), false);
}
public static void ClearXsltCacheOnCurrentServer(this DistributedCache dc)
{
if (UmbracoSettings.UmbracoLibraryCacheDuration > 0)
{
ApplicationContext.Current.ApplicationCache.ClearCacheObjectTypes("MS.Internal.Xml.XPath.XPathSelectionIterator");
}
}
}
}