oqtane.framework/Oqtane.Client/Services/CacheService.cs
2025-03-03 17:54:33 +01:00

24 lines
717 B
C#

using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Oqtane.Documentation;
using Oqtane.Shared;
namespace Oqtane.Services
{
/// <inheritdoc cref="ICacheService" />
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
public class CacheService : ServiceBase, ICacheService
{
public CacheService(HttpClient http, SiteState siteState) : base(http, siteState) { }
private string ApiUrl => CreateApiUrl("Cache");
public async Task EvictOutputCacheByTag(string tag, CancellationToken cancellationToken = default)
{
await DeleteAsync($"{ApiUrl}/outputCache/evictByTag/{tag}");
}
}
}