Serial vs Parallel Request Patterns
You'll learn how request dependencies force sequential loading and how to restructure requests to load resources in parallel for better performance.
When browsers fetch resources, they can do so in two fundamental patterns: serial (one after another) or parallel (multiple at once). Understanding the difference dramatically impacts your site's load time.
The Problem with Serial Chains
Serial requests happen when one resource depends on another. Imagine this scenario:
- Browser downloads HTML (500ms)
- HTML references a CSS file → downloads CSS (300ms)
- CSS uses a web font → downloads font (400ms)
- Total time: 1200ms
Each request waits for the previous one to complete before starting. This creates a "waterfall" where resources cascade down your timeline, adding delays at each step.
The Power of Parallel Loading
When resources don't depend on each other, browsers can fetch them simultaneously:
- Browser downloads HTML (500ms)
- At the same time: CSS, JavaScript, and images all start downloading
- Total time: ~500ms (approximately the longest single resource)
Think of it like a restaurant: serial is one waiter serving tables one-by-one, while parallel is multiple waiters working simultaneously.
Breaking Serial Dependencies
To optimize, identify and eliminate unnecessary dependencies:
- Use
<link rel="preload">to start critical downloads early - Load fonts directly in HTML rather than waiting for CSS to parse
- Avoid importing one JS module that imports another that imports another
- Use async/defer attributes to prevent blocking
- Consider inlining critical CSS to avoid the CSS → font chain
Key Takeaway: Serial request chains multiply latency by the number of dependencies; restructuring for parallel loading can reduce total load time to just the duration of your slowest individual resource.