Tymur Yarosh
Tymur Yarosh

Reputation: 623

Does OkHttp reuse HTTP1/1 connections automatically?

My application has to send a lot of http requests to the same server. It may be 20 or more requests which responses should be handled as quickly as possible. In this case I want to reuse already instantiated by first request TCP connection for all next requests cause it should dramatically improve performance. While researching the topic I've found out that OkHttp has ConnectionPool where it stores reusable connections. It's led me to the question does OkHttp reuse HTTP1/1 connections or only HTTP2 and SPDY? How OkHttp api user can change this behavior?

Upvotes: 9

Views: 4159

Answers (1)

baywet
baywet

Reputation: 5342

Yes it does by default, and here is the updated link

Upvotes: 2

Related Questions