Code does not seem to be the issue here.
I would guess one of the following is happening
- You are being rate limited? (Unlikely to hit limits with a smaple app but stil easy to check with response codes)
- Loading is taking more than 2 seconds (default net http response timeout is 2 seconds and default faraday setup is with net:http)
What would I do in this situation. I would the following before deciding on next steps
Print the response object error codes and http headers in the api client gem from its response object. I would be looking for what is the caching header in response and what is the status code.
If you have ngrep on your production machine, just let it print and show the entire http request response instead of printing it in the gem.
If the response takes more than 2 seconds, increase timeout settings for net::http and check.