Streamlines how Template cache gets invalidated - ensures Save() is called on templates where it was needed,

cache now gets invalidated on events.
This commit is contained in:
Shannon Deminick
2013-02-07 05:26:53 +06:00
parent cf8a0728d8
commit d93ca26181
9 changed files with 74 additions and 50 deletions

View File

@@ -17,6 +17,16 @@ namespace Umbraco.Web.Cache
dc.Refresh(new Guid(DistributedCache.TemplateRefresherId), templateId);
}
/// <summary>
/// Removes the cache amongst servers for a template
/// </summary>
/// <param name="dc"></param>
/// <param name="templateId"></param>
public static void RemoveTemplateCache(this DistributedCache dc, int templateId)
{
dc.Remove(new Guid(DistributedCache.TemplateRefresherId), templateId);
}
/// <summary>
/// Refreshes the cache amongst servers for all pages
/// </summary>
@@ -75,5 +85,15 @@ namespace Umbraco.Web.Cache
{
dc.Refresh(new Guid(DistributedCache.MacroCacheRefresherId), macroId);
}
/// <summary>
/// Removes the cache amongst servers for a macro item
/// </summary>
/// <param name="dc"></param>
/// <param name="macroId"></param>
public static void RemoveMacroCache(this DistributedCache dc, int macroId)
{
dc.Remove(new Guid(DistributedCache.MacroCacheRefresherId), macroId);
}
}
}