HTTP keep-alive reuses a connection for later requests, avoiding repeated connection setup and TCP slow-start. Go’s net/http server and client support reuse by default. section 12.3.1
Preserve connection reuse by:
- Using http.Get or http.Post, which rely on a keep-alive-enabled default client and transport. section 12.3.1
Custom transport
Create an http.Transport with TLS settings, compression preferences, and a net.Dialer whose KeepAlive is set to 30 seconds; attach it to an http.Client.
