resolves #4899: output cache for sitemap
This commit is contained in:
23
Oqtane.Client/Services/CacheService.cs
Normal file
23
Oqtane.Client/Services/CacheService.cs
Normal file
@ -0,0 +1,23 @@
|
||||
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}");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user