liveBook · Manning

Connection reuse

As explained in Go in Practice, Second Edition

Connection reuse is the practice of sending multiple network requests over an already established connection.

Connection reuse sends multiple HTTP requests over an established connection, avoiding repeated connection negotiation, TLS setup, and TCP slow-start. Go's net/http package attempts this by default, but application antipatterns can bypass it. section 12.3.1

Preserve reuse by configuring and consuming HTTP responses carefully:

  • Distinguish HTTP keep-alive from TCP keep-alive; HTTP/2 also provides transparent support in net/http from Go 1.6. section 12.3.1

How Go in Practice, Second Edition covers it

How deep it goes
Explains negotiation, TLS, TCP slow-start, transports, and response-body handling, but stops short of benchmarking or server implementation.
Examples
Uses custom Go transports and contrasting response-body listings to show configuration and an application antipattern.
What it assumes
Assumes basic HTTP requests and Go usage while introducing transport configuration and connection-lifecycle pitfalls.
What you can do after
Apply it via Go's net/http client, reusable transports, dialers, and prompt response-body closure.
How it connects
Connects HTTP keep-alive, TCP keep-alive, TLS, TCP slow-start, HTTP/1.1, HTTP/2, and response-body management.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Go in Practice, Second Edition. The section links point to the parts of the book it draws on.