Saturday, 5 September 2020

Multiple small requests vs One big request for data fetching

I am about to create a dashboard that shows the user some general data. Currently, I want to show 4 cards and 2 diagrams. Due to using react, I am thinking of creating a Card component and a Diagram component, and, inside the component, fetch all the necessary information for it to render. This way, when the Dashboard page is "called", every one of this components will perform a request on the server, 6 in total. Is this a bad practice? Should I make one big request to grab all of this info and then just pass it as props?

Submitted September 05, 2020 at 09:11AM by pigiou

No comments:

Post a Comment