How-To Guide

How to Replace HTTP/2 Server Push with Preload

Server push failed in practice. Replace it with preload links, 103 Early Hints, and cache-aware delivery that respects what the client already has.

On this page

  1. Introduction
  2. Why server push failed
  3. Use preload correctly
  4. Enable 103 Early Hints
  5. Serve cache-aware on first visits
  6. Prefetch is not preload
  7. Verify the migration
  8. Common pitfalls
  9. Conclusion

Introduction

HTTP/2 server push let a server send resources the client had not requested, on the theory that the server knows the next needed asset better than the browser does. In practice the theory failed. The server cannot see the browser cache, so it pushed bytes the client already owned, wasted shared bandwidth, and competed with requests the browser actually wanted to issue. Chrome removed push support in version 106, other browsers restricted or disabled it, and intermediaries frequently stripped PUSH_PROMISE frames anyway. A codebase that still depends on push is carrying dead weight that misbehaves on most modern clients. The capabilities push promised are still achievable with three cooperating techniques: preload links that the browser fetches eagerly, 103 Early Hints that move discovery earlier in the connection, and cache-aware delivery that adapts to what the visitor already has. This tutorial walks through each technique and shows how to migrate off push safely.

Why server push failed

Push has a structural blind spot: the PUSH_PROMISE frame is emitted before the client can report whether it already owns the resource. A returning visitor with a warm cache receives the CSS, the font, and the hero image again. The browser must then discard the duplicates, which wastes upstream bandwidth shared with every other user behind the same connection. Push also bypassed browser prioritization. Assets arrived with a server-chosen priority and could delay the HTML document that the parser was blocked waiting for, a direct regression on largest contentful paint. Finally, the deployment story never converged: proxies, load balancers, and CDNs each handled or dropped push frames differently, so behavior varied across the path. The industry conclusion was that push helped a narrow first-visit case, cost every subsequent visit, and could not be fixed without a standardized cache digest that clients never adopted. Understanding this failure matters because every replacement technique exists to fix one specific part of it.

Use preload correctly

Preload is a declarative hint that tells the browser to fetch a resource now, with high priority, before the parser discovers it through normal markup. Unlike push, the browser stays in control: it checks its own cache first, applies its own prioritization, and cancels the fetch if the resource turns out to be unnecessary. Preload works in two forms. A link tag in the HTML head covers cases where the document itself is the only place the dependency is known. A Link response header lets the server emit hints for resources the markup never mentions, such as a font referenced only inside a stylesheet.

<link rel="preload" href="/fonts/inter-var.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/css/article.css" as="style">
<link rel="preload" href="/img/hero.avif" as="image" fetchpriority="high">

Every attribute must match the eventual consuming request. The as attribute determines the cache partition and the priority class; a mismatch produces a warning and a second download. Fonts require crossorigin even when served from the same origin, because font fetching uses anonymous CORS mode. Images that are the largest contentful paint candidate benefit from fetchpriority set to high, which lifts them above other preload traffic.

Enable 103 Early Hints

Preload only helps once the browser has the HTML, but rendering a dynamic page can take hundreds of milliseconds of server time. Early Hints splits the response in two: the server first sends a 103 informational response carrying Link headers, then computes the real page and sends the final status. The browser starts fetching critical assets while the server is still rendering, which removes most of the round trip that preload cannot. Node.js 18 and later expose this through writeEarlyHints on the server response. The feature is safe by design: if an intermediary buffers or drops the 103, the browser simply waits for the final response, so the failure mode is the status quo rather than a regression.

app.get('/article/:slug', (req, res, next) => {
 res.writeEarlyHints({
  link: [
   '</css/article.css>; rel=preload; as=style',
   '</fonts/inter-var.woff2>; rel=preload; as=font; crossorigin',
  ],
 });
 renderArticle(req.params.slug, (err, html) => {
  if (err) return next(err);
  res.set('cache-control', 'public, max-age=300, stale-while-revalidate=86400');
  res.send(html);
 });
});

Keep the hint list short and static. Computing personalized hints defeats the purpose, because the 103 must leave before expensive work begins. Two to four entries covering the stylesheet, the primary font, and the hero image capture most of the win.

Serve cache-aware on first visits

The one case push genuinely helped was the very first visit with a cold cache, where the server had real knowledge the client lacked. That benefit is better captured without a transport-level mechanism. Inline the critical CSS directly into the HTML head so the first render does not wait on a stylesheet request. Keep the inlined block small, ideally under 14 kilobytes so it fits within the initial congestion window, and preload the full stylesheet for subsequent navigation. For fonts, the modern approach is to accept a brief swap: use a metric-compatible fallback with font-display swap, or preload the single variable font file that covers the page. For returning visitors, fingerprinted URLs plus long-lived immutable caching make every subsequent visit cost zero bytes for static assets, which is the outcome push was trying and failing to deliver. A cookie or a service worker cache can even let the server distinguish cold from warm visitors, though most sites get equivalent results from the simpler combination of inlining, fingerprinting, and preload.

Prefetch is not preload

Prefetch asks the browser to fetch a resource for the next navigation, at idle priority, and it is frequently confused with preload during migrations. Use rel=prefetch for the next page a user is likely to visit, such as the next article in a series. Use rel=preload for resources the current page needs right now but the parser would discover late. Mixing them up either delays the current page or wastes bandwidth on speculation. When migrating off push, audit each pushed asset and ask which category it belongs to. Pushed CSS and fonts become preload. Pushed next-page documents become prefetch, if the product wants that behavior at all. Pushed analytics scripts become nothing: they should load normally with defer, because promoting their priority regresses the metrics that matter. This triage is the core of the migration and it is a product decision, not a mechanical rewrite.

Verify the migration

Measure before and after with the same tooling, on the same hardware profile. Record largest contentful paint, the number of preload hints consumed, and total transferred bytes for a cold cache and a warm cache separately, because the warm case is where push was actively harmful and the migration should show a bandwidth improvement. In Chrome DevTools, the Network panel shows preload entries initiated by the document and flags unused preloads with a warning. Verify Early Hints in the Protocol column or with a raw connection. The push code path should be deleted, not disabled behind a flag, and a smoke test should assert that no PUSH_PROMISE frames appear on any route. Confirm intermediaries forward 103 responses by checking a request through the production CDN, since some providers strip informational responses.

curl -sD - -o /dev/null --http2 https://example.com/article/42 | grep -iE '^(HTTP|link|cache-control)'

A healthy result shows the 103 line followed by the final 200, Link headers on both, and a cache-control policy that lets warm visitors skip the network for static assets entirely.

Common pitfalls

  • Preload mismatches the consumer. A wrong as, crossorigin, or query string turns one download into two.
  • Preloading everything. Priority inflation means nothing is prioritized; keep the hint list to critical-path assets.
  • Expecting 103 to reach the client. Some CDNs and proxies buffer informational responses; verify end to end before crediting the win.
  • Inline CSS that grows without bound. Critical CSS must be extracted and bounded, or the HTML itself becomes the bottleneck.
  • Keeping push behind a flag. Dead code paths drift and eventually break during upgrades; delete them once metrics confirm parity.
  • Ignoring the warm-cache case. The migration is only complete when returning visitors transfer near-zero static bytes.

Conclusion

Server push is gone from the browsers that matter, and its replacement is not a single feature but a division of labor. Preload moves discovery earlier with the browser still in control of caching and priority. Early Hints moves the hint itself earlier by splitting the response before slow rendering. Inlining and fingerprinting cover the cold-start case push was designed for. Migrate by triaging each pushed asset into one of these techniques, measure cold and warm visits separately, and remove the push path completely rather than leaving it dormant. The result is the performance push promised, delivered by mechanisms that actually work across the deployed web.

Sources: MDN: rel=preload, RFC 8297: 103 Early Hints, Chrome: HTTP/2 push is deceased.

FAQ

Is HTTP/2 server push still supported anywhere?
Chrome and Edge removed it in version 106, Firefox disabled it by default, and Safari ships only partial support. A design that depends on push cannot rely on it reaching a meaningful share of users.
Can preload cause double fetching?
Yes, when the preload hint and the consuming tag disagree on the URL, the as attribute, or crossorigin. Match the hint to the real request exactly, including query strings, or the browser downloads the resource twice.
When should I skip preload entirely?
Skip it when the parser discovers the resource quickly inside the initial HTML, or when the asset is low priority. Preload only pays off for critical resources that normal discovery would reach late.

Related Examples