Introduction
React native seems to have inherited the behavior of web browsers that they have a set amount of concurrent connections for certain platforms. As react native is built on top of native abstractions as opposed to browser ones. These limitations seem arbitrary and can be configured. This could allow for some apps to see an increase in performance.
The Core of It
React Native's primary targets are iOS and Android. Each of the implementations used for http requests on the two platforms support the ability move away from the default value. On iOS, this abstraction seems to be made in RCTHTTPRequestHandler.mm and on Android NetworkingModule.java.
iOS requires [configuration setHTTPMaximumConnectionsPerHost:8]; (8 can be any number) whereas android seems to need a "dispatcher" to be created.
Precedent for modifying the http behavior by platform exists in "ReactNetworkForceWifiOnly" in the iOS code, though I can't find anything similar for android. I'd assume it'd be possible to just add something to the app/build.gradle.
Discussion points
- What does the implementation look like on android? There seems be a lot of escape hatches for the OKHTTPClient to be made.
- What about platforms outside of iOS and Android.
- How do we test this?
Introduction
React native seems to have inherited the behavior of web browsers that they have a set amount of concurrent connections for certain platforms. As react native is built on top of native abstractions as opposed to browser ones. These limitations seem arbitrary and can be configured. This could allow for some apps to see an increase in performance.
The Core of It
React Native's primary targets are iOS and Android. Each of the implementations used for http requests on the two platforms support the ability move away from the default value. On iOS, this abstraction seems to be made in
RCTHTTPRequestHandler.mmand on AndroidNetworkingModule.java.iOS requires
[configuration setHTTPMaximumConnectionsPerHost:8];(8 can be any number) whereas android seems to need a "dispatcher" to be created.Precedent for modifying the http behavior by platform exists in "ReactNetworkForceWifiOnly" in the iOS code, though I can't find anything similar for android. I'd assume it'd be possible to just add something to the
app/build.gradle.Discussion points