I am having a issue with the template on my page WoodburyWeather.com with slow page loads. It only happens when cached data is being refreshed, when it has been a while since the last page view. These slow page loads will result in a blank page for anywhere from 30-120 seconds while PHP is processing in the background. I figured out that it only happened when certain cached data was being refreshed.
I'm unsure of when this started. It's been happening for at least a week almost now perhaps a month.
I narrowed it down to a issue in wxastronomy.php, more specifically get-USNO-sunmoon.php, and very specifically I think it's having issues connecting to
Code: Select all
http://api.usno.navy.mil/rstt/oneday?date=$lclToday&coords=$myLat,$myLong&tz=$myTZOffset
Code: Select all
http://api.usno.navy.mil/rstt/oneday?date=03/21/2016&coords=41.553333,-73.224167&tz=-4
On the wxastronomy.php page, I get the following above the Sun and Moon.
Code: Select all
Warning: Invalid argument supplied for foreach() in /home/woodburyman/woodburyweather.com/get-USNO-sunmoon.php on line 359
Warning: Invalid argument supplied for foreach() in /home/woodburyman/woodburyweather.com/get-USNO-sunmoon.php on line 368
Once in a while, if I clear the cache, I will get a healthy 900byte+ byte USNO-moondata.txt in the cache folder. The PHP errors will disappear. Even on these load times, it can take 30-60 seconds of waiting. I believe their site or something is having issues, and is causing a time out.
Just wondering if anyone else is having these issues, or if there's any further testing I can do to narrow it down?