← CodeClarityLab Home
Browse by Category
+ added · updated 7d
← Back to glossary

HTTP/2 Server Push & Early Hints

networking Intermediate

TL;DR

HTTP/2 Server Push lets a server proactively send assets (CSS, JS, fonts) before the browser requests them. 103 Early Hints is its practical successor — sending Link preload headers before the full response is ready.

Explanation

HTTP/2 Server Push allowed servers to send additional resources alongside the initial HTML response, avoiding a round trip for critical assets. In practice it suffered from a fundamental problem: the server cannot know which assets the browser already has cached, leading to wasted bandwidth pushing already-cached resources. Major CDNs (Cloudflare, Chrome) deprecated or removed Server Push support. 103 Early Hints (RFC 8297) is the modern replacement — the server sends a preliminary 103 response with Link: rel=preload headers immediately, while still generating the full page. The browser starts fetching those assets during the server think-time. Unlike Push, the browser controls whether to actually fetch each hint, respecting its own cache. In PHP this is emitted with header('HTTP/1.1 103 Early Hints') before any output.

Watch Out

Server Push was deprecated by Chrome in 2022 and removed by several major CDNs — do not invest in implementing it. Use 103 Early Hints or Link preload headers instead.

Common Misconception

HTTP/2 Server Push is not the same as preload — Push sends the bytes unconditionally; a preload hint lets the browser decide whether to fetch based on its cache.

Why It Matters

103 Early Hints can shave 100–500ms from perceived load time on server-rendered pages by overlapping asset fetches with server processing time — a measurable Core Web Vitals improvement.

Common Mistakes

  • Using Server Push without cache-awareness — pushing already-cached assets wastes bandwidth and can trigger redundant downloads.
  • Sending 103 Early Hints after output has started — the 103 must be sent before any body bytes.
  • Hinting too many resources — hinting 20 assets defeats the purpose; hint only render-blocking critical resources.

Avoid When

  • Avoid HTTP/2 Server Push for new projects — browser support is being removed; use 103 Early Hints or <link rel=preload> instead.
  • Do not hint resources that are already in the browser cache for returning users — measure cache hit rates before adding hints.

When To Use

  • Send 103 Early Hints for render-blocking CSS and critical fonts on server-rendered pages where DB or API latency is the bottleneck.
  • Use Early Hints via CDN (Cloudflare, Fastly) when your origin supports it — the CDN can replay hints from cache without hitting origin.

Code Examples

💡 Note
The 103 response is sent immediately before the slow DB work begins — the browser fetches critical CSS during the server think-time, so the render-blocking resource arrives before the HTML does.
✗ Vulnerable
// Server Push — deprecated, may be ignored or cause duplicate downloads:
header('Link: </style.css>; rel=preload; as=style', false);
// Some servers interpret this as a push directive
✓ Fixed
// 103 Early Hints — modern, cache-aware:
header('HTTP/1.1 103 Early Hints');
header('Link: </critical.css>; rel=preload; as=style', false);
header('Link: </font.woff2>; rel=preload; as=font; crossorigin', false);
ob_flush(); flush();

// ... expensive DB queries happen here ...
// Browser is already fetching CSS and font in parallel

Added 31 Mar 2026
Views 11
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings W 0 pings T 0 pings F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W 0 pings T 0 pings F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W 0 pings T 0 pings F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W 1 ping T 0 pings F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W 0 pings T
No pings yet today
No pings yesterday
Google 2 Perplexity 1 Ahrefs 1
crawler 4

✓ schema.org compliant