I have a rails app that calls a third party API for weather.
The problem is that the API call is generally very slow and sometimes fails. Showing the weather is no
The recommended way is to call to the API in the background (using a scheduler) and save the result in the database. Then in the controller you can get the data from the database and there won't be any delay.