Files
Umbraco-CMS/src/Umbraco.Web/Cache/TemplateCacheRefresher.cs
Shannon Deminick 56fb570267 Adds a constant id for the template distributed cache object, adds extension method to DistrubutedCache to refresh the template cache,
Changes all distrubuted cache calls for templates to use extension method.
2013-02-07 03:49:45 +06:00

45 lines
931 B
C#

using System;
using Umbraco.Core;
using umbraco;
using umbraco.interfaces;
namespace Umbraco.Web.Cache
{
public class TemplateCacheRefresher : ICacheRefresher
{
public string Name
{
get
{
return "Template cache refresher";
}
}
public Guid UniqueIdentifier
{
get
{
return new Guid(DistributedCache.TemplateRefresherId);
}
}
public void RefreshAll()
{
}
public void Refresh(Guid id)
{
}
public void Refresh(int id)
{
ApplicationContext.Current.ApplicationCache.ClearCacheForTemplate(id);
}
public void Remove(int id)
{
ApplicationContext.Current.ApplicationCache.ClearCacheForTemplate(id);
}
}
}