XMLHttpRequest POST sometimes fails when server is using keep-aliv

March 09th, 2010 - 08:41 am ET by Artur S | Report spam
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
(http://support.microsoft.com/kb/831167/en-us). 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.

email Follow the discussionReplies 3 repliesReplies Make a reply


#1 Gordon
March 16th, 2010 - 08:50 am ET | Report spam
"Daniel H" wrote in message news:
I was very happy to finally come across this post.

Please note:
This is NOT a chat room and You are NOT posting to a forum run by
Eggheadcafe - you are actually posting to a global Usenet Newsgroup. You
will get a far better experience if you use a newsreader and subscribe to
these groups directly, rather than through Eggheadcafe.

Setting up Outlook Express/Windows Mail to access Microsoft newsgroups

Accessing the MS newsgroups in Outlook Express/Windows Mail Newsreader

If you must stay with Egghheadcafe then please follow Usenet custom by NOT
changing the subject line.

Thank you.

Similar topics