Frontend School
DashboardProblemsLearnPracticeMock InterviewReportsStatsBuy Credits
DashboardProblemsLearnPracticeMock Interview
Frontend System Design Roadmap
  1. 1.HTTP/1.1 vs HTTP/2 vs HTTP/3 (QUIC)
  2. 2.TCP and TLS Handshakes: Connection Setup Costs
  3. 3.Browser Network Stack and Connection Pooling
  4. 4.GET vs POST and Idempotency in HTTP
  5. 5.The Critical Rendering Path (CRP)
  6. 6.DOM, CSSOM and the Render Tree
  7. 7.Layout, Paint and Compositing
  8. 8.Reflows and Repaints Explained
  9. 9.Event Loop: Call Stack, Task and Microtask Queues
  10. 10.Async JavaScript: Promises and async/await
  11. 11.Web Workers: Multi-threading in the Browser
  12. 12.Browser Storage: Cookies, Web Storage, IndexedDB
  13. 13.Client-Side Storage: Limits and Security Risks
  14. 14.Choosing the Right Client-Side Storage
  15. 15.HTTP Caching: Cache-Control, ETag, Last-Modified
  16. 16.Browser-Level Caching Mechanisms
  17. 17.Cache Invalidation for Frontend Apps
  18. 18.Structuring a Large Single-Page App
  19. 19.Component-Based Architecture Principles
  20. 20.Props, State and Component Lifecycle
  21. 21.Module Bundling Basics
  22. 22.Core Web Vitals: LCP, INP and CLS
  23. 23.FCP and Time to Interactive (TTI) Explained
  24. 24.Measuring Performance: Lighthouse and WebPageTest
  25. 25.Asset Compression and Minification Basics
  26. 26.What Is a CDN and How Does It Work?
  27. 27.CDN Benefits: Latency, Availability, Offload
  28. 28.CDN Cache Behavior and Invalidation
  29. 29.Global State vs Local Component State
  30. 30.State Patterns: Redux, Zustand and Context
  31. 31.Data Fetching: React Query and SWR
  32. 32.Immutable Data in Frontend State
  33. 33.SSR vs CSR: Rendering Trade-offs
  34. 34.Hydration and Time to First Byte (TTFB)
  35. 35.Static Site Generation (SSG) for Speed and SEO
  36. 36.Incremental Static Regeneration (ISR)
  37. 37.Micro-Frontends: Core Principles
  38. 38.Micro-Frontend Integration Strategies
  39. 39.Communication Between Micro-Frontends
  40. 40.Micro-Frontends: Pros and Cons for Large Teams
  41. 41.Real-Time: Polling, SSE and WebSockets
  42. 42.Real-Time Use Cases: Chat, Alerts, Live Data
  43. 43.Designing a Real-Time Data Flow
  44. 44.Scaling WebSocket Connections
  45. 45.Responsive Images: srcset, sizes and picture
  46. 46.Modern Image Formats: WebP, AVIF, JPEG XL
  47. 47.Lazy Loading Images and Videos
  48. 48.Video Streaming: HLS, DASH, Adaptive Bitrate
  49. 49.REST and GraphQL for Frontend Engineers
  50. 50.Batching, Throttling and Debouncing API Calls
  51. 51.Handling API Errors in the Frontend
  52. 52.Authentication Flows: OAuth and JWT
  53. 53.Global Error Boundaries in React
  54. 54.Error Reporting: Sentry and LogRocket
  55. 55.Graceful Degradation and Fallback UIs
  56. 56.Real User Monitoring (RUM)
  57. 57.CORS: Cross-Origin Resource Sharing
  58. 58.Preventing XSS (Cross-Site Scripting)
  59. 59.CSRF Protection for Frontend Apps
  60. 60.Content Security Policy (CSP)
  61. 61.Storing Auth Tokens: Cookies vs localStorage
  62. 62.PWA Manifest and Installability
  63. 63.Service Workers: Lifecycle and Caching Strategies
  64. 64.Offline Support and Background Sync
  65. 65.Push Notifications for Web Apps
  66. 66.Webpack vs Vite vs Parcel
  67. 67.Code Splitting, Tree Shaking, Asset Optimization
  68. 68.Module Resolution and Hot Module Replacement
  69. 69.Monorepo Tooling: Nx and Lerna
  70. 70.Atomic Design for Component Libraries
  71. 71.Theming and Customization in Design Systems
  72. 72.Accessibility in Component Libraries
  73. 73.Component Library Docs, Testing and Versioning
  74. 74.Publishing and Consuming a Component Library
  75. 75.Full-Text Search: Levenshtein and Fuzzy Matching
  76. 76.Indexing Large Datasets in the Browser
  77. 77.Search Performance: Debouncing and Web Workers
  78. 78.Integrating Backend Search Services
  79. 79.Choosing a Chart Library: D3, Chart.js, Recharts
  80. 80.Rendering Large Datasets: Canvas vs SVG
  81. 81.Interactive, Responsive Data Visualizations
  82. 82.Data Fetching and Aggregation for Dashboards
  83. 83.A/B Test Design and Rollout Strategies
  84. 84.Client-Side vs Server-Side A/B Testing
  85. 85.Feature Flags and Remote Configuration
  86. 86.Experiment Data Collection and Analytics
Frontend System Design Roadmap
03

Frontend System Design · Lesson 3 of 86 · 4 min

Browser Network Stack and Connection Pooling

This is how you explain why your app feels slow and what the browser does about it.

After this, you'll be able to explain the single most important performance optimization browsers perform for HTTP/1.1 and why it’s still a bottleneck. This comes up when discussing asset loading strategy or diagnosing latency.

The Real Cost of a Network Request

A network request isn't just about sending data. The browser's network stack has to work through multiple layers—from your fetch call at the application layer down to TCP at the transport layer—before a single byte of your request payload is sent.

As you know from the last lesson, establishing that TCP connection and wrapping it in TLS is expensive. The back-and-forth handshakes add significant latency, often 100-300ms, before any application data is exchanged.

Paying this setup cost for every single resource—every image, CSS file, and API call—would make any modern web application unusably slow.

How Browsers Reuse Connections

To avoid paying the setup tax repeatedly, browsers use connection pooling. When the browser makes a request to an origin like api.example.com, it doesn't close the connection after getting a response. Instead, it keeps the connection open and places it in a "pool" for that origin.

When another request is made to api.example.com, the browser checks the pool for an idle, ready-to-use connection. If one is available, it sends the new request over the existing connection, completely skipping the TCP and TLS handshakes.

This behavior is enabled by the Connection: keep-alive HTTP header, which is the default for HTTP/1.1. It's a signal from the client and server to keep the TCP connection open for potential reuse.

The trap: If a server is misconfigured and sends Connection: close, it forces the browser to establish a new connection for every single request to that origin. This kills performance, and you can spot it in the network timing breakdown for each request.

The HTTP/1.1 Bottleneck: The 6-Connection Limit

Connection pooling is a huge win, but it has a major limitation in HTTP/1.1. Browsers limit the number of concurrent connections to a single origin. For most modern browsers, this limit is 6.

This means if you try to download 20 images from the same domain simultaneously, the browser will open 6 connections. It will request the first 6 images, and the other 14 requests will be queued, waiting for one of the first 6 to complete and free up a connection.

This creates head-of-line blocking at the connection level. Even though the images might be small, they are forced to wait their turn for a free connection slot.

In an interview, if you're asked to design a page that loads many assets, mentioning this 6-connection limit is non-negotiable. It proves you understand real-world browser constraints and the bottlenecks of HTTP/1.1. It's the reason techniques like domain sharding were invented (though they are now an anti-pattern with HTTP/2).

How to See It in Action

You don't write code to manage this pool; the browser does it for you. But you can observe its effects. Run this code in your browser console and open the Network tab in your developer tools.

async function fetchMultipleResources() {
  const baseUrl = 'https://jsonplaceholder.typicode.com';

  console.log('Starting multiple fetch requests to the same origin...');

  const promises = [
    fetch(`${baseUrl}/users/1`),
    fetch(`${baseUrl}/posts/1`),
    fetch(`${baseUrl}/comments/1`),
    fetch(`${baseUrl}/albums/1`),
    fetch(`${baseUrl}/photos/1`),
    fetch(`${baseUrl}/todos/1`),
    fetch(`${baseUrl}/users/2`), // 7th request
  ];

  try {
    const responses = await Promise.all(promises);
    console.log('All requests completed.', responses);
    console.log('Check your browser\'s network tab to see timings and connection IDs.');
  } catch (error) {
    console.error('An error occurred:', error);
  }
}

fetchMultipleResources();

In the Network tab (e.g., in Chrome DevTools), right-click the table headers and enable the "Connection ID" column. You will see that all requests to jsonplaceholder.typicode.com share a small number of connection IDs. You may also notice in the "Timing" tab for each request that subsequent requests have a "Stalled" or "Queued" time, and a near-zero "Initial connection" or "SSL" time, proving a connection was reused.

The Modern Answer: HTTP/2 Multiplexing

Connection pooling is an optimization for a flawed protocol. The core problem is that an HTTP/1.1 connection can only handle one request/response at a time.

HTTP/2 solves this with multiplexing. It allows multiple requests and responses to be interleaved over a single TCP connection. With HTTP/2, the browser opens just one connection to an origin and can fire off dozens or hundreds of requests in parallel over that one connection without any head-of-line blocking.

This effectively makes the 6-connection limit irrelevant for servers that support HTTP/2.

The interview power-up: When asked about loading many assets, first explain the HTTP/1.1 connection pooling and its 6-connection limit. Then, follow up by explaining that this problem is largely solved by HTTP/2's multiplexing, which uses a single connection far more efficiently. This shows your knowledge is current.

Try it

Open a media-heavy site like an e-commerce category page. In your browser's DevTools, go to the Network tab, enable the "Connection ID" and "Protocol" columns, and filter by "img". Observe how the browser juggles a small number of connections (if the site uses HTTP/1.1) or funnels most requests through a single connection (if it uses HTTP/2, shown as h2).

Next: GET vs POST and Idempotency in HTTP.

Lock it in — apply this lesson under interview conditions.

Try a free mock interviewPractice system design problems
Previous

TCP and TLS Handshakes: Connection Setup Costs

Next

GET vs POST and Idempotency in HTTP