How to handle if there's need for multiple API to be called when render a page?
I have a question whereby when there's multiple api to be called, should it be called separately or combined them as one?
For example, i have a page to create product. I have to fetch several data and populated into the dropdown selection.
From the scenario above, should i create another api to return all the required data as a single request instead calling multiple request to get the data?
If the external API calls are so slow that your page/site appears unresponsive, I would consider
(i) a background job to fetch and cache the third party data so it is available whenever the view is rendering, or
(ii) rendering a view which separately makes asynchronous calls for the third party data (with appropriate loading states displayed).