My webpage uses Google charts to create five charts. If the charts are not cached yet, I have the following line of code that retrieves the image.
$ image = file_get_contents (" http://chart.apis.google.com/chart ?". $ query);
When this code executes in a loop, it takes 10 seconds to get each image. But if I change the code to use one of the Google IPs instead of the URL:
$ image = file_get_contents (" http://74.125.93.100/chart ?". $ query);
Images take less than one second. So, my initial thought was that DNS does not resolve the URL, and the delay is due to the cyclical use of the designated DNS servers? So I tried to execute ping chart.apis.google.com from the server and immediately answered a reasonable answer.
So my question is: is there any PHP (or Apache2) configuration parameter that might be missed that might cause this delay, or does this sound like a server configuration problem?
php
Kevin
source share