Can OkHttp reuse HTTP1 / 1 connections automatically?

My application must send many http requests to the same server. This can be 20 or more requests, the answers to which should be processed as quickly as possible. In this case, I want to reuse the TCP connection already created on the first request for all subsequent requests, so it should significantly improve performance. While studying the topic, I found that OkHttp has a ConnectionPool where reusable connections are stored. This led me to the question that OkHttp is reusing HTTP1 / 1 connections or only HTTP2 and SPDY? How can the OkHttp api user change this behavior?

+5
source share

Source: https://habr.com/ru/post/1241265/


All Articles