Streamlines how Member cache data gets invalidated

This commit is contained in:
Shannon Deminick
2013-02-07 04:57:44 +06:00
parent ea24e43c90
commit cf8a0728d8
6 changed files with 11 additions and 34 deletions

View File

@@ -94,32 +94,6 @@ namespace Umbraco.Web
}
}
}
}
/// <summary>
/// Clears the library cache for members
/// </summary>
/// <param name="cacheHelper"></param>
/// <param name="memberId"></param>
/// <param name="allServers">
/// If set to false, this will only clear the library cache for the current server, not all servers registered in the
/// server farm. In most cases if you are clearing cache you would probably clear it on all servers.
/// </param>
public static void ClearLibraryCacheForMember(this CacheHelper cacheHelper, int memberId, bool allServers = true)
{
const string getmemberCacheKey = "GetMember";
if (allServers && UmbracoSettings.UseDistributedCalls)
{
DistributedCache.Instance.RefreshMemberCache(memberId);
}
else
{
cacheHelper.ClearCacheByKeySearch(
string.Format("UL_{0}_{1}", getmemberCacheKey, memberId));
}
}
/// <summary>