---
title: "Better HTTP/1 connection reuse"
description: "Go 1.27's net/http.Transport now asynchronously drains unread HTTP/1 response bodies, up to 50 ms or 256 KB, before closing them."
url: "https://swe.quest/articles/better-http-1-connection-reuse-5d9fec83e52eecb5"
canonical: "https://go.dev/blog/http-connection-reuse"
source: "The Go Blog"
published: "2026-10-14"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 7
tags: ["go","networking","performance"]
---

# Better HTTP/1 connection reuse

A post on [The Go Blog](https://swe.quest/sources/go.md), published 2026-10-14, 7 min read, Deep dive. Original: [https://go.dev/blog/http-connection-reuse](https://go.dev/blog/http-connection-reuse)

## Summary

Go 1.27's net/http.Transport now asynchronously drains unread HTTP/1 response bodies, up to 50 ms or 256 KB, before closing them. Connections can then be reused instead of abandoned, which made a 100-request status-check loop about 5x faster (710 ms to 150 ms). Before this change, any unread bytes, even a trailing newline left by encoding/json.Decoder, forced a new TCP+TLS handshake costing several RTTs. The recommendation is to drop hand-rolled drain helpers, which are also unnecessary for HTTP/2, and simply close response bodies.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Go](https://swe.quest/tags/go.md) (Languages)
- [Networking](https://swe.quest/tags/networking.md) (Infrastructure)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- HTTP/1.1 keep-alive
- TCP and TLS handshakes ([easy posts on Networking](https://swe.quest/tags/networking.md?difficulty=easy))
- Go net/http client ([easy posts on Go](https://swe.quest/tags/go.md?difficulty=easy))

## Keywords

net/http, HTTP/1.1, HTTP/2, Go 1.27, TLS, encoding/json

## Related posts

- [Next level customer experience with HTTP/3 traffic engineering](https://swe.quest/articles/next-level-customer-experience-with-http-3-traffic-engineering-d70ad19a21697e79.md): Zalando Engineering · 2024-06-17 · Medium · 13 min read · Networking, CDN & edge, Web performance, Mobile
  HTTP/3 over QUIC addresses TCP-era protocol inefficiencies: head-of-line blocking, multi-round-trip handshakes (5-6 for cold HTTP/2 vs 3 for HTTP/3), layered TLS overhead, kernel-bound congestion control and lack of connection migration.
- [Retrospective and Technical Details on the recent Firefox Outage](https://swe.quest/articles/retrospective-and-technical-details-on-the-recent-firefox-outage-762d01b617459060.md): Mozilla Hacks · 2022-02-02 · Medium · 6 min read · Incidents & postmortems, Networking, Browsers, Testing, Rust
  On January 13, 2022, Firefox hung worldwide for about two hours after Google Cloud silently made HTTP/3 the default on load balancers left at "Automatic", causing Telemetry connections to switch from HTTP/2 to HTTP/3.
- [Learn How to Lower Heroku Dyno Latency through Persistent Connections (Keep-alive)](https://swe.quest/articles/learn-how-to-lower-heroku-dyno-latency-through-persistent-connections-keep-alive-3816d278b532e549.md): Heroku Engineering · 2025-11-04 · Medium · 6 min read · Networking, Performance engineering, Ruby, Cloud platforms
  HTTP keep-alive connections cut latency by reusing TCP connections, so repeat requests skip the handshake and TCP slow start and run at full bandwidth.
- [Quicker serverless Postgres connections](https://swe.quest/articles/quicker-serverless-postgres-connections-7a37a1071edd4362.md): Neon · 2023-03-28 · Medium · 8 min read · PostgreSQL, Networking, Serverless, Performance engineering, Cryptography
  Neon cut the network round-trips needed to get a first query result from its WebSocket-based serverless Postgres driver from nine to four.
- [Upgrade to Puma 7 and Unlock the Power of Fair Scheduled Keep-alive](https://swe.quest/articles/upgrade-to-puma-7-and-unlock-the-power-of-fair-scheduled-keep-alive-798a2f5419631b82.md): Heroku Engineering · 2025-11-05 · Medium · 11 min read · Ruby, Concurrency, Performance engineering, Networking
  Puma 6 and earlier let a single keep-alive connection monopolize a thread for up to 10 requests via the "fast inline" loop originally built for HTTP pipelining, so under overload about one in ten requests waited roughly 10x longer while later keep-alive requests cut the line.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
