Firstly I will try to explain how the setup I am trying to debug works.
Some other information:
The problem:
On the initial request, there is a 30 second wait time until a response is returned, it's almost like the servers are asleep and need waking up. After the initial request successfully gets a response, subsequent requests are returned in less than 1 second. If no requests are made for a space of time (say 30 minutes), the slow initial request happens again.
A direct request to the PHP Auth API never has this long wait, the same goes for the Windows IIS endpoint - but when there's a cURL between the two, the long wait occurs.
Can anyone point me in the right direction here? Maybe it's something obvious that I haven't considered? Would "Keep connection alive" type parameters be of help?
I hope I have explained the problem properly and if more information is needed, just ask.
Thank you Stack Overflow!
Have you considered that as this is the 'first' time you have called the API, that the API itself may have just gone to sleep, and its own initialisation has startup steps which take a little time to run.