You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You will see that it first sends an incomplete chunk of data to the server:
POST / HTTP/1.1
content-type: multipart/form-data; boundary=--------------------------602269624292240232678615
Host: example.com
Content-Length: 273
Connection: close
----------------------------602269624292240232678615
Content-Disposition: form-data; name="foo"
Some text
After that, Nagle's algorithm kicks in and blocks the remaining data until the server sends an ACK. Then it's sent:
In conclusion, all requests made with form-data have at least 1 RTT of delay added to them. This may not seem much (146ms for me), but for servers that are far away and/or lots of requests, it has a substantial impact.
We have tracked this down to felixge/node-combined-stream#38. Before that PR, data chunks were written synchronously and Node.JS could buffer them into a single write to the socket. After the change, buffering is not possible.
Activity
Update combined-stream (fixes form-data#422)
Update combined-stream (fixes form-data#422)
Merge pull request #424 from botgram/update-combined-stream