Open chancewen opened 10 years ago
We need more details to investigate on this issue.
We are experiencing the same. For now I can only add that we see that if you refresh the page the problem disappears. Maybe we are experiencing a different bug, but seems to me it's related. I try to get some more details. We are using the library in a webfarm like environment where we have set the machinekey to be the same on all the machines.
I couldn't reproduce this, but after looking at the code it might be a threading issue. In the ExecuteCallback (which is stored in the HttpContext), the library uses a variable "cachingWriter" which is set as the output writer before the result is executed. The code results in a closure.
Now I don't know how .NET compiles closures, but could it perhaps be that if one thread calls the cachingWriter.toString() and another thread just created a new cachingWriter, the first call results in a empty string as it is a new StringWriter?
I don't what to answer actually, in normal conditions ASP.NET MVC handles each request on a separate thread and sticks to it. If it's not the case, I clearly don't know what to do.
I'm guessing in this case, that this project won't work when using Async Controllers in MVC4 onwards?
http://www.codeguru.com/csharp/.net/net_asp/mvc/creating-asynchronous-actions-in-asp.net-mvc.htm
We don't have any update on this, we have projects using async controllers in production, who, of course make use of MvcDonutCaching with no problem. Added that, since MVC4 all controller internal infrastructure is async by default.
Fantastic :) This is an excellent project.
Actually we have similar issue - sometimes is page just empty. Should we rewrite controller actions to async, or why @leen3o mention it?
I had it too. Running on azure. Problem is, the status code is still OK, so my monitors dont alert me...
In my case I found that removing this line fixed my issue,
"ControllerContext.RequestContext.RouteData.Values.Remove(value.Key);"
there should be some problems removing values from ControllerContext.RequestContext.RouteData that cause that the page become a blank page without throwing any error.
PD: If you add the removed value after removing it, that also fix the issue, like this
ControllerContext.RequestContext.RouteData.Values.Add(value.Key, value.Value);
I use mvcdonutcaching on one page of my site. It runs well except that sometimes the page becomes blank page, so that I must restart IIS to recover. the problem happens every a few days.
I wonder if this problem is related to mvcdonutcaching.
Thanks a lot!