2013-02-12 04:13:29 +06:00
|
|
|
|
using System;
|
|
|
|
|
|
using Umbraco.Core;
|
2013-03-12 03:00:42 +04:00
|
|
|
|
using Umbraco.Core.Cache;
|
2013-02-12 04:13:29 +06:00
|
|
|
|
using umbraco.interfaces;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.Cache
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Handles User cache invalidation/refreshing
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class UserCacheRefresher : ICacheRefresher
|
|
|
|
|
|
{
|
|
|
|
|
|
public Guid UniqueIdentifier
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return Guid.Parse(DistributedCache.UserCacheRefresherId); }
|
|
|
|
|
|
}
|
|
|
|
|
|
public string Name
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return "User cache refresher"; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void RefreshAll()
|
|
|
|
|
|
{
|
2013-03-12 03:00:42 +04:00
|
|
|
|
ApplicationContext.Current.ApplicationCache.ClearCacheByKeySearch(CacheKeys.UserCacheKey);
|
2013-02-12 04:13:29 +06:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Refresh(int id)
|
|
|
|
|
|
{
|
|
|
|
|
|
Remove(id);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Remove(int id)
|
|
|
|
|
|
{
|
2013-03-12 03:00:42 +04:00
|
|
|
|
ApplicationContext.Current.ApplicationCache.ClearCacheItem(string.Format("{0}{1}", CacheKeys.UserCacheKey, id.ToString()));
|
2013-02-12 04:13:29 +06:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Refresh(Guid id)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|