I’m hoping I’m just missing some setup. Currently we are using If-Modified-Since headers to try and improve some performance of some endpoints. The base setup is as follows
Plugins.Add(new CorsFeature(allowedHeaders: "Content-Type, authorization, If-Unmodified-Since, If-Modified-Since"));
GetPlugin<HttpCacheFeature>().DefaultMaxAge = TimeSpan.Zero;
Our endpoint returns a result as follows:
return new HttpResult(response)
{
LastModified = maxDate,
CacheControl = CacheControl.NoCache | CacheControl.Private
};
Now when we call the endpoint, initially we get a status 200 with the result returned, a last-modified date and cache-control max-age=0, private, no-cache which is expected.
The second time we get a 304 and no last-modified, which is expected, but the cache-control is private only. My expectation is that it’s as the first call, as we defined it.
As a result, a 3rd call to the endpoint returns 200, cache-control private and has pulled from disk cache instead of hitting the endpoint again to verify.