Weather App API very Laggy

Weather App API very Laggy
0

#1

Hello campers. I recently finished the weather app, but when I go back to look at my finished project, it takes a good 5 seconds for any information to be retrieved from the weather API and into my app. Any ideas why it’s taking so long? Here is the link to my app:

https://codepen.io/jcalderaio/pen/MOLdMK


#2

Not seeing much lag on my end. Could be your isp throttling your connection. :wink: Not really sure.

FYI - I do not see an image/icon which represents the current weather in my location. The weather description show “haze”, but I see not image as the one of the project user stories requires.


#3

FYI - I do not see an image/icon which represents the current weather in my location. The weather description show “haze”, but I see not image as the one of the project user stories requires.

Ok, so you don’t see what I circled in red when you open my project?


#4

I’m not seeing much lag either on my computer. But keep in mind that geolocation can be slow, especially on mobile when the GPS is having trouble finding you (5-10 seconds is not unusual). Maybe you can display a message like “Getting weather information” while waiting for the data to come back so that the user knows what is going on.

Concerning icons, the FreeCodeCamp weather API doesn’t always provide an icon with its data, I don’t know why. I made my app more general so that the user can get weather from anywhere in the world as an alternative to geolocation (it’s much faster, even on broadband) so I’ve tested getting weather for all sorts of places, and sometimes you get an icon, sometimes you don’t. Haze and snow seem to be particularly prone to missing the icon. There was an interesting thread not long ago that mentioned getting weather icons independently from the API.