Fixes: #U4-1930, #U4-1928, #U4-1929 - addes ContentTypeCacheRefresher to ensure that content type cache is cleared
in load balanced scenarios. Cleans up a bit of code too.
This commit is contained in:
@@ -210,6 +210,32 @@ namespace Umbraco.Web.Cache
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove all cache for a given content type
|
||||
/// </summary>
|
||||
/// <param name="dc"></param>
|
||||
/// <param name="contentType"></param>
|
||||
public static void RemoveContentTypeCache(this DistributedCache dc, IContentType contentType)
|
||||
{
|
||||
if (contentType != null)
|
||||
{
|
||||
dc.Remove(new Guid(DistributedCache.ContentTypeCacheRefresherId), x => x.Id, contentType);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove all cache for a given media type
|
||||
/// </summary>
|
||||
/// <param name="dc"></param>
|
||||
/// <param name="mediaType"></param>
|
||||
public static void RemoveMediaTypeCache(this DistributedCache dc, IMediaType mediaType)
|
||||
{
|
||||
if (mediaType != null)
|
||||
{
|
||||
dc.Remove(new Guid(DistributedCache.ContentTypeCacheRefresherId), x => x.Id, mediaType);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clears the cache for all macros on the current server
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user