Files
Umbraco-CMS/src/Umbraco.Web/Cache/UserCacheRefresher.cs

42 lines
1.0 KiB
C#
Raw Normal View History

using System;
using Umbraco.Core;
2013-03-12 03:00:42 +04:00
using Umbraco.Core.Cache;
using umbraco.interfaces;
namespace Umbraco.Web.Cache
{
/// <summary>
/// Handles User cache invalidation/refreshing
/// </summary>
public sealed 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);
}
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()));
}
public void Refresh(Guid id)
{
}
}
}