We use a Windows 2008 R2 Enterprise server and IIS7.5.7600.16385, and I deployed a simple server (asp.net mvc, C #,. Net framework 4.5.1) on the server. the controller as shown below and * .cshtml only output the date and time:
public class DetailController : Controller { [OutputCache(Duration = 300, VaryByParam = "id")] public ActionResult Index(int id) { return View(); } }
when I first request the URL http: // localhost: 80 / Detail / Index? id = 3 , the answer is correct:
Cache-Control:public, max-age=300 Date:Mon, 24 Oct 2016 12:11:59 GMT Expires:Mon, 24 Oct 2016 12:16:51 GMT Last-Modified:Mon, 24 Oct 2016 12:11:51 GMT
but when I request the url again (ctrl + f5), the maximum age is wrong (then the answer is from the server cache):
Cache-Control:public, max-age=63612908450 Date:Mon, 24 Oct 2016 12:16:34 GMT Expires:Mon, 24 Oct 2016 12:20:50 GMT Last-Modified:Mon, 24 Oct 2016 12:15:50 GMT
I do not know why max-age is so large, and how it is generated, it will be converted when the output cache expires (ctrl + f5). In my env production, an invalid maximum age causes a URL link to read contents from the browser cache.
Does anyone know how and how to fix it?
mofee source share