Adds a constant id for the member distributed cache object,

adds extension method to DistrubutedCache to refresh the member cache,
Changes all distrubuted cache calls for members to use extension method.
This commit is contained in:
Shannon Deminick
2013-02-07 03:58:47 +06:00
parent b6ec42334b
commit a1c2352dca
3 changed files with 13 additions and 4 deletions

View File

@@ -53,6 +53,16 @@ namespace Umbraco.Web.Cache
{
dc.Remove(new Guid(DistributedCache.PageCacheRefresherId), pageId);
}
/// <summary>
/// Refreshes the cache amongst servers for a member
/// </summary>
/// <param name="dc"></param>
/// <param name="memberId"></param>
public static void RefreshMemberCache(this DistributedCache dc, int memberId)
{
dc.Refresh(new Guid(DistributedCache.MemberCacheRefresherId), memberId);
}
}
/// <summary>
@@ -75,6 +85,7 @@ namespace Umbraco.Web.Cache
public const string TemplateRefresherId = "DD12B6A0-14B9-46e8-8800-C154F74047C8";
public const string PageCacheRefresherId = "27AB3022-3DFA-47b6-9119-5945BC88FD66";
public const string MemberCacheRefresherId = "E285DF34-ACDC-4226-AE32-C0CB5CF388DA";
#endregion

View File

@@ -9,7 +9,7 @@ namespace Umbraco.Web.Cache
public Guid UniqueIdentifier
{
get { return new Guid("E285DF34-ACDC-4226-AE32-C0CB5CF388DA"); }
get { return new Guid(DistributedCache.MemberCacheRefresherId); }
}
public string Name

View File

@@ -113,9 +113,7 @@ namespace Umbraco.Web
if (allServers && UmbracoSettings.UseDistributedCalls)
{
DistributedCache.Instance.Refresh(
new Guid("E285DF34-ACDC-4226-AE32-C0CB5CF388DA"),
memberId);
DistributedCache.Instance.RefreshMemberCache(memberId);
}
else
{