Wunderground Animated Radar 503 and zero size error

  • 1
  • Question
  • Updated 4 years ago
I have a php script that accesses a radar image using the following url.

http://api.wunderground.com/api/$myAP...

The first request almost ALWAYS returns a broken image w/ a 503 error. Accessing the image directly in browser via the url gives me a "Service Unavailable- Zero sized object". A subsequent request in either case will pull the image in as it should.

My question is, why is it doing this? Do I need to extend the connection timeout in php to give the server more time to create the image? I recognize it is a rather large image and is probably built on the fly. Any help/direction would be hugely appreciated.
Photo of coryb123

coryb123

  • 4 Posts
  • 0 Reply Likes
  • ready to understand

Posted 4 years ago

  • 1
Photo of WunderWilliam

WunderWilliam

  • 267 Posts
  • 18 Reply Likes
That is a pretty big file -- I would try increasing the timeout first.
Photo of coryb123

coryb123

  • 4 Posts
  • 0 Reply Likes
I have tried this. It appears your server is timing out the request.
Photo of WunderWilliam

WunderWilliam

  • 267 Posts
  • 18 Reply Likes
Can you get it at half or quarter of the size? That might help narrow down the cause of the issue.
Photo of coryb123

coryb123

  • 4 Posts
  • 0 Reply Likes
Yes, I can get it at half size without any issue. I can get it at the size I want it just takes two requests (I'm assuming because the first request starts the image building process, but while building the image your server reaches a timeout, the subsequent request asks for the same image and get's the image because the first request had the image building process started and nearly complete).
Photo of WunderWilliam

WunderWilliam

  • 267 Posts
  • 18 Reply Likes
It's probably best to either decrease the resolution of the request, or do two requests and combine them. The API doesn't support images of that size without a timeout.
Photo of coryb123

coryb123

  • 4 Posts
  • 0 Reply Likes
Orrrrrrrrr. You guys cache a super-low, low, med, high, and super-high res image of the major areas (ie West, Midwest, East) of the United States every few minutes. That's be super efficient and super awesome. Stay wunderful wunderground.