after following some cache tutorials in .ASP Net Core, and performed some local tests i have some doubts related:
Steps I did
I added the header
[ResponseCache(VaryByHeader = "User-Agent", Duration = 180)]
Http responses has the proper header
cache-control: public,max-age=180
Conclusion
Despite the headers are OK, the response is never cached in any browser.
Questions
My first question is, why private caches are not saving that request for that request? The only way to make it working is to configure in the startup :
app.UseResponseCaching();
But as I have checked it results in an API call that return the data from the cache store in the API/server. Second question is why browser needs to hit the API?
Someone can explain why the browsers are no caching anything? (I have checked that it si enabled in Developer tools)
Many thanks in advance