This repository has been archived on 2025-05-14. You can view files and clone it, but cannot push or open issues or pull requests.
2025-03-11 11:48:43 -04:00

31 lines
737 B
C#

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 OutputCacheController : Controller
{
private readonly IOutputCacheService _cacheService;
public OutputCacheController(IOutputCacheService cacheService)
{
_cacheService = cacheService;
}
// DELETE api/<controller>/{tag}
[HttpDelete("{tag}")]
[Authorize(Roles = RoleNames.Admin)]
public async Task EvictByTag(string tag)
{
await _cacheService.EvictByTag(tag);
}
}
}