2013-02-06 09:53:13 +06:00
|
|
|
|
using System;
|
|
|
|
|
|
using Umbraco.Core;
|
2013-03-12 03:00:42 +04:00
|
|
|
|
using Umbraco.Core.Cache;
|
2013-02-06 09:53:13 +06:00
|
|
|
|
using umbraco;
|
|
|
|
|
|
using umbraco.interfaces;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.Cache
|
|
|
|
|
|
{
|
|
|
|
|
|
public class TemplateCacheRefresher : ICacheRefresher
|
|
|
|
|
|
{
|
2013-03-12 03:00:42 +04:00
|
|
|
|
|
2013-02-06 09:53:13 +06:00
|
|
|
|
public string Name
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return "Template cache refresher";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Guid UniqueIdentifier
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
2013-02-07 03:49:45 +06:00
|
|
|
|
return new Guid(DistributedCache.TemplateRefresherId);
|
2013-02-06 09:53:13 +06:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void RefreshAll()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Refresh(Guid id)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Refresh(int id)
|
|
|
|
|
|
{
|
2013-02-07 05:26:53 +06:00
|
|
|
|
RemoveFromCache(id);
|
2013-02-06 09:53:13 +06:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Remove(int id)
|
|
|
|
|
|
{
|
2013-02-07 05:26:53 +06:00
|
|
|
|
RemoveFromCache(id);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void RemoveFromCache(int id)
|
|
|
|
|
|
{
|
|
|
|
|
|
ApplicationContext.Current.ApplicationCache.ClearCacheByKeySearch(
|
2013-03-12 03:00:42 +04:00
|
|
|
|
string.Format("{0}{1}", CacheKeys.TemplateCacheKey, id));
|
2013-02-06 09:53:13 +06:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|