resolves #4899: output cache for sitemap

This commit is contained in:
David Montesinos
2025-03-03 17:54:33 +01:00
parent 9e5922e121
commit eab3a753f5
11 changed files with 138 additions and 3 deletions

View File

@ -0,0 +1,31 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Oqtane.Models;
using Oqtane.Services;
using Oqtane.Shared;
namespace Oqtane.Controllers
{
[Route(ControllerRoutes.ApiRoute)]
public class CacheController : Controller
{
private readonly ICacheService _cacheService;
public CacheController(ICacheService cacheService)
{
_cacheService = cacheService;
}
// DELETE api/<controller>/outputCache/evictByTag/{tag}
[HttpDelete("outputCache/evictByTag/{tag}")]
[Authorize(Roles = RoleNames.Admin)]
public async Task EvictOutputCacheByTag(string tag, CancellationToken cancellationToken = default)
{
await _cacheService.EvictOutputCacheByTag(tag, cancellationToken);
}
}
}