views:

121

answers:

0

Hello. Client side Ajax Javascript code is using XMLHttpRequest to send a POST request, but I'm getting like a 0.5 second delay in getting the response and I'm trying to find out why, since I'd like it to be faster, more like 0.2 seconds. Both endpoints are in the same intranet, the client directly connected via ethernet and the server using 802.11b.

Using Wireshark I sniffed the following TCP transactions:

Time(ms).....From............To..............Info
0.0...............client...........server.........[SYN]
11.7............server..........client..........[SYN,ACK]
11.8............client...........server.........[ACK]
12.0............client...........server.........[POST]
12.1............client...........server.........Continuation
39.0............server...........client.........ACK
46.0............server...........client.........ACK
150.0..........server...........client.........TCP segment of reassembled PDU
311.0..........client.............server.......ACK
324.0..........server............client........HTTP/1.1 200 OK (text/html)
512.0..........client.............server.......ACK

The actual post and response are really short. Basically the content of the post request is (without the quotes):

"cmd=getCurXY&chan=CH_L_JX"

And the content of the response that I'm sending right now is simply:

"cmd=noresponse"

The response is being sent as a "Transfer-Encoding: chunked".

Could this transaction be speeded up in some way?
Why does it need a whole half second?