- How do you deal with slow external API?
- Why is API response slow?
- Why first network call takes more time than subsequent ones?
How do you deal with slow external API?
One of the ways to handle slow API responses is by having the custom component update the user with wait messages. This article has shown a scalable approach by using NoSQL Database on OCI infrastructure as a cache.
Why is API response slow?
An API may be invoked on multiple JVMs. If one JVM has slowed down considerably, the response time of all APIs run in that JVM increases. Therefore, an API's response time may exceed the threshold due to one JVM responding slowly.
Why first network call takes more time than subsequent ones?
Due to HTTP keep-alive mechanism, subsequent requests to the same server will reuse the existing TCP connection to prevent another TCP handshake, thus reducing three round-trip time compared the first request. Content Download: Due to TCP slow start, the first request will need more time to download content.