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

@@ -75,12 +75,12 @@ namespace Umbraco.Web.Cache
static void MemberBeforeDelete(Member sender, DeleteEventArgs e)
{
ApplicationContext.Current.ApplicationCache.ClearLibraryCacheForMember(sender.Id);
DistributedCache.Instance.RefreshMemberCache(sender.Id);
}
static void MemberAfterSave(Member sender, SaveEventArgs e)
{
ApplicationContext.Current.ApplicationCache.ClearLibraryCacheForMember(sender.Id);
DistributedCache.Instance.RefreshMemberCache(sender.Id);
}
}
}

View File

@@ -4,7 +4,7 @@ using umbraco.interfaces;
namespace Umbraco.Web.Cache
{
public class MemberLibraryRefreshers : ICacheRefresher
public class MemberCacheRefresher : ICacheRefresher
{
public Guid UniqueIdentifier
@@ -23,7 +23,10 @@ namespace Umbraco.Web.Cache
public void Refresh(int id)
{
ApplicationContext.Current.ApplicationCache.ClearLibraryCacheForMember(id, false);
const string getmemberCacheKey = "GetMember";
ApplicationContext.Current.ApplicationCache.
ClearCacheByKeySearch(string.Format("UL_{0}_{1}", getmemberCacheKey, id));
}
public void Remove(int id)