Go 1.27 reuses HTTP/1 connections even when response bodies go unread
The net/http transport now drains unread HTTP/1 bodies in the background, which the Go team says cut a benchmark from about 710 ms to 150 ms.
The Go team has described a change in Go 1.27 to how net/http handles HTTP/1 connections. In earlier releases, closing a response body that had not been read to the end caused the client to abandon the connection and open a new one for the next request.
That behaviour could quietly slow down code that only checks a status code, or that stops reading just short of the end of a body, for example after decoding a JSON object followed by a newline. In the team's own benchmark of 100 requests over HTTP/1, the run dropped from roughly 710 milliseconds on Go 1.26 to roughly 150 milliseconds on Go 1.27.
Starting in Go 1.27, the transport drains an unread HTTP/1 body asynchronously, for up to 50 ms or 256 KB, so the connection can go back into the pool. It skips the drain when the response carries a Connection: close header, since the work would be wasted. HTTP/2 was never affected.
For developers, the team's guidance is to close response bodies when they are finished and drop hand-written drain helpers that were added as workarounds. The post notes that the exact behaviour may change in later versions, so code that relies on a specific drain limit is best avoided.
Sources
Verified Oct 23, 2026 (official source). gohttpperformance