Ajax Javascript client code uses XMLHttpRequest to send a POST request, but I get a 0.5 second delay in receiving the response, and I'm trying to figure out why, because I would like it to be faster, more than 0.2 seconds. Both endpoints are on the same intranet, the client is directly connected via ethernet and the server using 802.11b.
Using Wireshark, I looked at 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 message and response are really short. Basically the content of the POST request:
cmd=getCurXY&chan=CH_L_JX
And the content of the response I'm sending right now is simple:
cmd=noresponse
The response is sent as Transfer-Encoding: chunked .
Can this transaction speed up somehow?
Why do I need a whole half second?
source share