← Lessons

quiz vs the machine

Silver1120

Networking

HTTP2 Server Push In Depth

How a server sends resources before the client asks for them.

4 min read · intro · beat Silver to climb

The Idea

When a browser requests a page, it usually needs the stylesheet and scripts that the page references. Server push lets the server send those extra resources proactively instead of waiting for follow up requests.

How It Works

The server sends a special push promise frame that names a resource it intends to deliver. It then streams that resource on a new stream as if the client had asked for it.

  • The promise reserves a stream identifier for the pushed resource.
  • The client can accept the push or reject it with a cancel.
  • Pushed responses land in the cache for later requests.

Why It Was Attractive

  • It can save one full round trip for critical assets.
  • The server, which already knows the page, primes the client early.
  • A first paint may arrive faster on a fresh visit.

Why It Faded

Push often sent resources the browser already had, wasting bandwidth. The server could not see the client cache, so it guessed badly. Many stacks now favor a preload hint that lets the client decide. Major browsers later removed push support in favor of these hints.

Key idea

Server push sends a promise then streams resources the client did not request, saving round trips, but blind guessing about caches made preload hints the preferred path.

Check yourself

Answer to earn rating on the learn ladder.

1. What frame announces a resource the server intends to push?

2. Why did server push fall out of favor?