Just reviewed a web page making 55 fetch calls totaling 570k of JSON
Just reviewed a web page making 55 fetch calls totaling 570k of JSON. This one page is 1.6 MB.
Why 55 calls? Because each database table is exposed as an endpoint. The UI joins all the JSON together via the provided foreign keys.
To be clear: Don't do this.
The fix:
1. Group related data into a course grained API.
2. Join the data on the server via SQL.
3. Decide what properties to expose.
4. Add filters, pagination, sorting as needed.