IIS7.5 maximum age issue (asp.net mvc output cache)

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?

+6
source share
2 answers

This is a known issue and the error is open for .NET 4.6.2 with KB151864.

See here https://github.com/Microsoft/dotnet/issues/330 for more details

This will be fixed in .NET 4.6.3. Currently, I do not know if the fix will be previously available for 4.6.2.

The only known workaround at this time is to downgrade and remove KB151864 whenever possible.

NOTE: the error only affects the compilation of the "maximum age" attribute in the Cache-Control header for cached responses. The actual caching mechanism and expiration work.

+5
source

I just talked with the Microsoft support group, and here is what they answered me:

The proposed solution is to refuse the operation of the frame from 4.6.2 to 4.6.1 by uninstalling the KB31511864 update.

Go to Control Panel → Programs → Programs and Features → Installed Updates. And uninstall KB3151864 , which will fix this problem.

0
source

Source: https://habr.com/ru/post/1011650/


All Articles