Better to save to DB first.
- If you pull direct from API when frontend reloads, you will easily hit the limit of the API (Assuming there is a rate limit)
- Frontend can also be slow if your API is slow, resulting in poor user experience
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am creating a betting site that i have to poll for updated data even every 5 seconds interval. So now i want to think of the best way between fetching data from api then save in db then front-end gets data from my db. Or i get the data directly from api to front-end. Which can be the best way.
Please or to participate in this conversation.