silkimen / cordova-plugin-advanced-http

Cordova / Phonegap plugin for communicating with HTTP servers. Allows for SSL pinning!
MIT License
400 stars 321 forks source link

iOS HTTPS transaction time ~2.5x slower than HTTP #450

Open ScottDodsonDev opened 2 years ago

ScottDodsonDev commented 2 years ago

On iOS, HTTPS is approximately 2.5x slower than HTTP. On Android, HTTP and HTTPS transaction times are about the same. iOS and Android HTTP transaction times are also comparable.

Server trust mode is set to nocheck. Requests are sent to a local server. Expect latency below 100ms but averaging 230ms when using HTTPS on iOS.

Is this a bug? This question is related to #25 ; however, Android is unaffected. Is there a way to improve HTTPS transaction time on iOS?

System info

silkimen commented 2 years ago

Hi @ScottDodsonDev, I agree 230ms latency sounds too much. How did you measure those values? Is it the time for the complete roundtrip or is it the diff between HTTP and HTTPS with exactly same setup? (e.g. same request endpoint, same request & response data, same sample size, etc.)

silkimen commented 2 years ago

Oh and thank you for sponsoring me :)

ScottDodsonDev commented 2 years ago

Hi @silkimen! Complete roundtrip with exactly the same setup. I left a comment on issue #115:

This was fixed in a8e3637f2728809377286aa00d85321f291d2f19 but reverted in 4b964e8b7c92b106c7c225197e8c3980f6d1f231.

As with @chrisjdev, what worked for me was reapplying the same fix for #115, but I had to remove the fix for #399.

silkimen commented 2 years ago

Are you experiencing the problems mentioned in #197 after reapplying #115 and removing #399?

ScottDodsonDev commented 2 years ago

I haven't experienced any issues; however, I don't use downloadFile().

silkimen commented 2 years ago

Thanks for your feedback! 👍

I'll test this combination on my side on a device. If I don't encounter any issues I think this should be a viable fix approach!