
If you are using an HTTP 1.0 client, ensure it supports the keep-alive directive and submit the header Connection: Keep-Alive with your request. Subsequent requests will result in reduced latency as the TCP handshaking process is no longer required. This keeps the underlying TCP connection active for multiple requests/responses. Please see following section on persistent connections to learn how to maintain a connection once it is established. To allow a better experience, using a persistent connection will allow more requests to be performed on an established connection.įor an established connection, we recommend limiting this to one hundred per second (100/s). Establishing a new TCP and SSL connection is expensive for both client and server. To provide equal resources to all clients, we recommend limiting both the number of new connections per second, and the number of requests per second made on a persistent connection (see above/below).įor new connections, we recommend you limit this to twice per second (2/s). Here is a set of best practices to use the API as efficiently as possible. The OANDA API development team strives to bring the best overall experience for our API users.
