I'm struggling to get response caching in an ASP.NET Core 2.0 web API working.
I've added response caching in the middleware:
public void ConfigureServices(IServiceCollection services)
{
services.AddResponseCaching();
...
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseResponseCaching();
...
}
Here my action method code:
[ResponseCache(Duration = 30)]
[HttpGet()]
public IActionResult GetLookups()
{
Lookup lookups = dataRepository.GetContactLookups();
}
Here's the postman request and response:

So, I'm getting the correct Cache-Control http header in the response but if I send the response again from postman, it still calls my code in my action method. I expected it to not call my code and use the cached response.
Am I misunderstanding the way that response caching works? Any help would be appreciated.
