I was very happy to finally come across this post. I have been banging my head against a problem with our web site that manifests itself only on high-latency connections (read: mobile) and only on a couple of pages that do lots of Ajax POSTs. I think I have come to the same conclusion as you.
Other suggestions than turning off Keep-Alive on the server-side would be greatly appreciated.
Artur S wrote:
XMLHttpRequest POST sometimes fails when server is using keep-aliv
Back in 2004 there was a bug in Internet Explorer 6 which caused the body
from POST requests to go missing if the server reset the connection
). The same bug is apparently
present in XMLHttpRequest in (at least) Internet Explorer 6, 7 and 8.
The problem can be simply reproduced by doing a POST with an XMLHttpRequest
to a server which is using a small keep-alive timeout, say 10s. If the POST
request is made right before the keep-alive timeout expires and there is a
slight network latency the web server will reset the connection and force IE
to resend the request. This time IE will "forget" to send the body but will
still send the old Content-Length header, resulting in the server waiting for
the body to arrive until a read timeout occurs.
The "right before" and "slight network latency" make it sound like this bug
is hard to reproduce but experiences have shown that this bug is not hard at
all to run in to while using a modern web application through e.g. a mobile
I have put a demo of this problem at
The keep-alive timeout is 15s so wait 14-15s and click the button. An alert
should popup when the response arrives and the button is re-enabled. At least
for me using a mobile connection it does not take more than 2-3 attempts in
IE8 to reproduce the problem.
The only solution seems to be to turn off keep-alive on the server (or maybe
set it to more than 60s). Has anyone else run into this and are there any
other ways to solve this problem? Has this been reported/discussed here
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.
Previous Posts In This Thread:
Submitted via EggHeadCafe - Software Developer Portal of Choice
SharePoint Video Library Template Available For Download