客户端Ajax Javascript代码使用XMLHttpRequest
发送POST请求,但我得到0.5秒的延迟获取响应,我试图找出原因,因为我会喜欢它更快,更像是0.2秒。两个端点位于同一个Intranet中,客户端通过以太网直接连接,服务器使用802.11b。POST回复花费太长时间
使用Wireshark的我闻以下TCP交易:
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
实际的帖子及回复真短。基本上POST请求的内容是:
cmd=getCurXY&chan=CH_L_JX
而且,我传送给现在的响应的内容很简单:
cmd=noresponse
的响应被发送作为Transfer-Encoding: chunked
。
这个交易能以某种方式加速吗?
为什么需要半秒钟?
你应该包括一些代码 – stevedbrown 2009-06-24 23:45:39