{
  "id": 14520588,
  "title": "Better HTTP/1 connection reuse",
  "url": "https://urgent.news/2026/10/14/better-http-1-connection-reuse",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-14T17:42:56.000Z",
  "source": {
    "name": "Lobsters",
    "slug": "lobsters",
    "url": "https://go.dev/blog/http-connection-reuse"
  },
  "original_language": "en",
  "account": "Nicholas Husin and Damien Neil report that the introduction of HTTP/1 in Go 1.27 has resulted in a significant performance improvement when compared to Go 1.26. In their benchmarking tests, making 100 GET requests to index.golang.org over HTTP/1 in Go 1.26 took approximately 710 milliseconds, while the same operation in Go 1.27 completed in just 150 milliseconds — a substantial 5 times faster. To understand why this drastic performance difference exists, it is crucial to examine the network behavior of HTTP requests. The Go net/http package supports HTTP/1.0, HTTP/1.1, and HTTP/2, all of which operate over TCP and often over TLS for HTTPS endpoints. When making an HTTP request, the process involves several round trips and incurs considerable CPU time, particularly when establishing new connections. These setup costs can dominate the total time taken, especially in cross-region communications where one-way latencies can reach or surpass 50ms. In HTTP/1, multiple requests and responses are sent sequentially on the same connection, and upon receiving a response, subsequent requests are only possible once the entire response body has been read or discarded. This design drawback becomes evident when considering a scenario where a client only needs an API response's status code but the server returns additional detail in the response body. This situation can lead to connection reuse failures, causing the client to repeatedly incur the expense of establishing new connections. In Go 1.26, this issue was exacerbated as the net/http package would abandon an existing connection if it detected an unread response body. The solution lies in safely draining the response body to allow connections to be reused. However, implementing safe body draining in Go 1.26 proved to be a complex and cumbersome process, with potential pitfalls such as misunderstanding the behavior in HTTP/2 connections. Starting with Go 1.27, the net/http.Transport has been enhanced to handle the body draining process for HTTP/1 requests automatically, asynchronously for up to 50ms or 256KB. Additionally, it has been optimized to skip draining the body when the server sends the Connection: close header. This automatic body draining functionality in Go 1.27 addresses the longstanding issue of connection reuse failures and simplifies the code, allowing developers to focus on writing clean and simple code while letting the net/http package manage the complexities on their behalf.",
  "summary": null,
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 2,
    "also_reported_by": [
      {
        "outlet": "Hacker News",
        "title": "Better HTTP/1 connection reuse in Go 1.27",
        "url": "https://urgent.news/2026/10/14/better-http-1-connection-reuse-in-go-1-27",
        "published": "2026-10-14T16:29:33.000Z"
      }
    ]
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}