Things API timeout
dillonfagan opened this issue · comments
Our Glitch API server goes to sleep after 5 minutes of inactivity (free tier), which means that the first request while asleep takes longer than normal. Since our Netlify functions have a short timeout, the first request to the API times out and never renders the things on the homepage.
We need to extend the Netlify function timeout.
Extending it isn't really an option, according to Netlify's docs. We might be able to cheat by doing a ping to the dummy "hello" endpoint first and then request the things from the API. Giving that a try now.
That cheat doesn't work. I think it simply takes too long for the API to fire back up. In my opinion, I think we have 2 options now:
- Hard-code the things on the homepage. (We could put them in a component to reduce the code on the page. However, this would only be a short-term solution, since we'll need to use the API for other features as we build out the app.)
- Pay for Glitch. ($96 for the year)
I paid for a year of Glitch, the API app is boosted, and the problem is now resolved.