Random 404 using IIS
What would cause IIS to return a 404, only sometimes? If I hit a 404 on a page, I can simply hit refresh and it will come up. It's reproducible. I've used fiddler to see what's going on and I don't see anything off. I've setup IIS tracing but again, I don't see what exactly the issue would be, the file exists and the 404 only occurs sometimes. By sometimes I mean if I navigated to a开发者_JAVA百科 page and got a 404 I could refresh and it would come up but other times I could navigate to that page and it would not 404. It isn't limited to any one page or condition.
What other things can I try to determine what the issue is?
If you've run Fiddler and you see the request arrive at the server and you see a 404, then this doesn't sound like a web farm problem.
You might want to try SysInternals ProcMon to see what's going on underneath.
The usual reason for this is that you have a web farm with several machines, on one machine the pages are missing.
Therefore, each time you randomly use the machine with the missing pages you get a 404.
I've had this similar issue and I traced it back to changing this:
<modules runAllManagedModulesForAllRequests="true" />
to:
<modules runAllManagedModulesForAllRequests="false" />
Obviously, analysis will need to be done to make sure that this doesn't affect your application in any other way.
I have only has this when an MVC application because for certain situations my routes were not correct. Clicking would produce the 404 but F5(refresh) would show the webpage correctly. You don't mention mvc but thought it worth throwing this in.
精彩评论