Performance: Sequential data fetching
MEDIUM IMPACT
This affects page load speed and interaction readiness by delaying data availability until each fetch completes in order.
const [data1, data2, data3] = await Promise.all([ fetch('/api/data1').then(res => res.json()), fetch('/api/data2').then(res => res.json()), fetch('/api/data3').then(res => res.json()) ]);
const data1 = await fetch('/api/data1').then(res => res.json()); const data2 = await fetch('/api/data2').then(res => res.json()); const data3 = await fetch('/api/data3').then(res => res.json());
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Sequential fetches | Minimal DOM nodes until data arrives | Single reflow after all data loads | High paint delay due to waiting | [X] Bad |
| Parallel fetches | Minimal DOM nodes until data arrives | Single reflow after all data loads | Lower paint delay, faster LCP | [OK] Good |