I am making use of DefaultAntiForgery in my Asp.Net Core application. I would like to enable ResponseCaching but getting this warning:
warn: Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery The 'Cache-Control' and 'Pragma' headers have been overridden
I added the [IgnoreAntiForgeryToken] on the method but still the same warning. Is there a way to do this without removing DefaultAntiForgery?
[ResponseCache(Duration = 86400, Location = ResponseCacheLocation.Any, NoStore = false)]
[IgnoreAntiforgeryToken]
public async Task<IActionResult> Index()
{
ViewData["SearchPlaceholder"] = "Search by Time";
return View();
}