I am using ASP.NET MVC 4 with WEB API
I have the following action, in the action shown below, my service method makes a db call to DoMagic()
method and
[ResponseCache]
is now supported in ASP.NET Core
Features may look identical to [OutputCache]
but [ResponseCache]
is only for the client side.
Response caching adds cache-related headers to responses. These headers specify how you want client, proxy and middleware to cache responses.
https://docs.microsoft.com/en-us/aspnet/core/performance/caching/response
[ResponseCache(Duration = 3600)]
[HttpGet]
public IEnumerable Get()
{
return _service.GetAll();
}