# Exercise 1: Diagnosing a Slow-Loading Page Under HTTP/1.1

## Scenario

You are handed a marketing landing page that loads slowly. A waterfall trace from the browser dev tools shows:

- The page references **42 separate assets** from `cdn.example.com`: 30 small icons (2-4 KB each), 8 CSS/JS bundles (30-80 KB each), and 4 hero images (200-400 KB each).
- All 42 requests go to the same origin, `cdn.example.com`, over **HTTP/1.1**.
- The browser opens 6 parallel TCP connections to that origin (the standard HTTP/1.1 per-host limit) and queues the rest.
- The 30 small icons visibly load in "bursts" — a batch of 6 finishes, then the next 6 start — with idle-looking gaps in the waterfall between bursts.
- Total page load time is dominated by the icon requests finishing, not by the large hero images.

## Deliverables

Answer each of the following, referencing the specific HTTP/1.1 mechanics from the theory file (not generic "just optimize images" advice):

1. **Explain the burst pattern.** Using the head-of-line blocking and 6-connections-per-host facts, explain precisely why the 30 icons load in visible batches of 6 rather than all starting immediately.

2. **Propose a fix that requires no protocol change.** Name a concrete HTTP/1.1-era technique that reduces the number of *separate* requests for the 30 icons (there is a well-known technique for bundling many small images into one request — name it and explain how it reduces the request count).

3. **Propose the fix if you can change the protocol.** Explain specifically why switching `cdn.example.com` to HTTP/2 would remove the need for both the 6-connection workaround and the icon-bundling technique from (2) — refer to multiplexing and streams, not just "HTTP/2 is faster."

4. **Identify a mistake to avoid.** This CDN currently also shards assets across `cdn1.example.com`, `cdn2.example.com`, and `cdn3.example.com` (a leftover HTTP/1.1 optimization to get more than 6 parallel connections). Explain why keeping that sharding *after* migrating to HTTP/2 would be counterproductive, and what you'd change instead.
