简体   繁体   中英

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?

是的,默认情况下,这是更新的链接

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM