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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user