Make ValueEditorCacheRefresher a distributed cache refresher
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) Umbraco.
|
||||
// See LICENSE for more details.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Umbraco.Cms.Core.Cache;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
@@ -106,6 +107,21 @@ namespace Umbraco.Extensions
|
||||
|
||||
#endregion
|
||||
|
||||
#region ValueEditorCache
|
||||
|
||||
public static void RefreshValueEditorCache(this DistributedCache dc, IEnumerable<IDataType> dataTypes)
|
||||
{
|
||||
if (dataTypes is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var payloads = dataTypes.Select(x => new DataTypeCacheRefresher.JsonPayload(x.Id, x.Key, false));
|
||||
dc.RefreshByPayload(ValueEditorCacheRefresher.UniqueId, payloads);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ContentCache
|
||||
|
||||
public static void RefreshAllContentCache(this DistributedCache dc)
|
||||
|
||||
Reference in New Issue
Block a user