Go 1.27 reuses more HTTP connections after response bodies close
Go 1.27 can reuse an HTTP/1 connection even when a caller closes a response without reading its entire body. The transport drains a bounded amount of leftover data in the background, avoiding another connection handshake when possible. This addresses cases such as checking only a status code or leaving a newline after decoding JSON. Callers must still close response bodies.
The Go Blog · Oct 14, 2026
Why it matters
Reusing a connection can avoid repeated network and encryption setup in otherwise ordinary client code.
More context
The implementation stops draining after 50 milliseconds or 256 KB, and skips it when the server requests connection closure. The authors demonstrate the change with repeated requests under HTTP/1. This is shipped Go 1.27 behavior; review manual draining helpers when upgrading.
Keep in mind
HTTP/2 handles concurrent response streams differently. The article’s timing example is one workload, not a general speedup for every HTTP client.
Original read