I have an asp.net mvc application which has the following setting in its web.config file:
<staticContent>
<clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" />
</staticContent>
My main page is served from the following action of my controller:
[OutputCache(Duration = 10, Location = OutputCacheLocation.Client, VaryByParam = "*")]
public ActionResult Index()
{
// ...
return View();
}
As one might guess, this is telling the browser to cache the Index page for 10 seconds. Looking at the headers in Chrome, I see the following:
The current time at which this request is made is exactly 15:56:50
My questions are:
- Given that the Expires header says: 14:46:57, why does Chrome fetch the page from its cache when I navigate out and back (using the back button) instead of going to the server?
- How can I tell the browser to go fetch the new pages that expired?