blob: 1dd547e908a65cdaaeb9771918770cfad70a1593 [file] [view] [edit]
HTTP/1 [Response.Body] now automatically drains any unread content upon being
closed, up to a conservative limit, to allow better connection reuse. For most
programs, this change should be a no-op, or result in a performance improvement.
In rare cases, programs that do not benefit from connection reuse might
experience performance degradation if they had been improperly allowing an
excessive amount of idle connections to linger; usually by setting
[Transport.MaxIdleConns] to `0` or using different [Client]s for different
requests, thereby bypassing [Transport.MaxIdleConns] limit. In these cases,
setting [Transport.DisableKeepAlives] to `true` will disable connection reuse.
However, such performance degradation usually indicates improper configuration
or usage of [Transport] or [Client] in the first place, and a deeper look would
likely be beneficial.