Tech article

Better HTTP/1 connection reuse in Go 1.27

No preview is available. Read the original article for the full story.

Hacker News | Oct 14, 2026 | allddd

Automated excerpt

Most commonly, this is io. Copy(io. Discard, body) // Drain the response body before closing it. the body. A better approach is to cap the number of bytes we are willing to io. CopyN(io. Discard, body, 256<<10) // Only drain up to 256 KB. io. CopyN(io. Discard, body, 256<<10) // Only drain up to 256 KB. // Only spend at most 50 ms trying to drain the response body. // If we reach the 50 ms timeout, body. Close will run and interrupt the response body. Instead, we can drain the body asynchronously in the background io. CopyN(io.

Selected automatically from source text; not independently written or fact-checked. Read the original for full context.

Read the original article

Read next

AI briefing: recent picks

More stories to explore