FCP bands
Why First Contentful Paint comes in 4 bands
We built the same Books app in 19 frameworks, twice each: once with the framework’s default settings and once optimized. First Contentful Paint (FCP), the moment the browser first draws text or an image, doesn’t spread out smoothly across them. It bunches into 4 bands, and each band is one more request the browser has to wait for before it can paint.
The 4 bands
FCP values bunch into 4 groups with gaps between them. Each group matches how many requests have to finish one after another before the page can paint. Take one request out of that chain and the app drops a whole band.
Every port, naive vs optimized
Each row is one port. The hollow marker is its build with the framework’s default settings, the filled marker its optimized build, and the line between them is what the optimization bought. With default settings most ports paint at about 1.5 s, in Middle. Optimized, every port paints at about 0.9 s, in Fast. Next and Angular (SSR) are already in Fast with default settings.
- default settings (naive)
- optimized
- FCP band
What each band waits on
0.9–1.0 sthe HTML is the only request
The first response holds everything needed to paint. The CSS is inlined in a <style> tag, the font is self-hosted and preloaded (or text paints in a fallback font while it loads), and the server sends the HTML without waiting on a slow database query.
Any app whose first paint needs only the HTML lands here, whatever the framework.
- Naive: Next and Angular (SSR).
- Optimized: every port.
1.1–1.5 sone link remains
The HTML arrives, then the browser waits for one more round of requests before it paints. Usually that is a stylesheet linked from the HTML: the app’s own CSS bundle, a Google Fonts stylesheet, or both fetched side by side. A self-hosted font that isn’t preloaded, or a server render that misses the cache, adds the same single step.
This is where most frameworks’ default settings put the Books app: the CSS ships as a separate file, so the browser can’t paint until it arrives.
- Naive: every port except Qwik City, Next, Waku and Angular (SSR).
1.7–2.0 stwo links remain, or the cache is cold
Two requests wait in sequence after the HTML, or the HTML itself is slow because a cache or a serverless worker was cold. A cold worker has to start, query the database and render before it sends the first byte. The same code can measure a band faster a few minutes later, once the cache is warm.
The fix is usually in caching and deployment, not in the components: keep the HTML cached at the edge and make the data cache persistent.
- Naive: Qwik City.
2.4–2.8 sthe full baseline waterfall
The full waterfall:
HTML (waits on a database query)
-> render-blocking CSS bundle
-> Google Fonts CSS from fonts.googleapis.com
-> woff2 from fonts.gstatic.com (display=block)
That is four requests in sequence, two of them to new origins. Preconnecting to the Google origins saves the DNS and TLS setup, but both requests still have to finish before text paints, because display=block hides text until the font arrives.
- No current build. The earlier naive builds of Ember, Nuxt, SolidStart, SvelteKit, Waku and Pracht landed here.
Why FCP moves in steps
The browser can’t paint text until a few things arrive, often one after another: the HTML; the stylesheet for that text, unless the CSS is inlined in the HTML; and, if the font loads with font-display: block, the font file. Each can depend on the one before it. This is the critical request chain, and every link in it costs a full round trip.
Under mobile Lighthouse (simulated Slow 4G and a 4× CPU slowdown), each round trip costs about 0.4–0.6 s, and they all cost about the same. Making a request smaller barely moves FCP. Removing it saves a whole step. A cache is either warm or cold, so it adds a step or it doesn’t.
That is why results bunch into bands instead of spreading out, and why a partial fix doesn’t move an app part of the way. Inlining the CSS while keeping a blocking font request leaves the app in the same band. It moves only when a whole link leaves the chain.
Where the Baseline band comes from
- earlier naive build
- earlier optimized build
- FCP band
An earlier round of measurements covered six ports whose naive builds used the full waterfall above: a linked CSS bundle and the Geist font loaded from Google Fonts. Every one of them landed in Baseline. Their optimized builds at that point had dropped Google Fonts but still kept one or two links in the chain, so they stopped around Middle instead of reaching Fast.
None of the current naive builds is that slow, so this is the only place on the site where the Baseline band is filled.
These are older builds than the chart above, and each figure is the average of single Lighthouse runs on Vercel, Netlify and Cloudflare, not a median of repeated runs. Read the two charts separately.
How to move an app into a faster band
01Remove the cross-origin font request
This change saved the most, about 1–1.5 seconds in these runs.
Replace the Google Fonts
<link>with a self-hosted font:@fontsource-variable/geist,next/fontor a woff2 file in the project.Preload the font so the browser requests it alongside the HTML:
<link rel="preload" as="font" type="font/woff2" href="/fonts/geist.woff2" crossorigin>Set
font-display: swaporoptionalso text paints in a fallback font instead of waiting.Once the font is local, delete the
preconnecthints forfonts.googleapis.comandfonts.gstatic.com.
solid-books/src/Document.tsxdoes all of this: it imports the woff2 file, preloads it and inlines the CSS.02Inline the stylesheet
The page can't paint until a separate stylesheet downloads. If the CSS is small (under about 10 KB gzipped), put it in the HTML:
- Next:
experimental.inlineCss: true. - SvelteKit:
inlineStyleThreshold: Number.POSITIVE_INFINITY(or a threshold in bytes). - Solid/Vite: import the CSS with
?inlineand render a<style>tag on the server. - Pracht:
inlineCss: true. - Nuxt:
features.inlineStyles: true.
For large CSS, serve the file from your own origin and preload it instead.
- Next:
03Cache the data the HTML depends on
If the server queries the database before sending the HTML, that query adds a full step, which no client-side change can remove.
- Next: mark the query
'use cache'and give it acacheLife. - Nuxt: use
defineCachedEventHandler, setnitro.storage.cacheand add arouteRulescache rule (Nitro cache docs). - SvelteKit, SolidStart and others: put a cache in front of the query, such as Vercel Runtime Cache, Netlify Blobs or the Cloudflare Cache API.
svelte-books/src/lib/server/catalog-cache.tspicks the right one for each host.
On Cloudflare, use a persistent cache. In-memory caches are lost between Worker isolates, so a cache that works on Vercel can miss on Workers without any error.
- Next: mark the query
04Make the HTML warm at the edge
A Worker that renders on every request adds a step even when the data is cached. Serve the HTML from a cache instead, using one of:
- static generation, where the page allows it;
- ISR or stale-while-revalidate;
- Cloudflare's Cache API (
caches.default) or KV for the rendered page; - Nitro's persistent cache driver for the host.
In the Cloudflare results, a cached HTML page is the difference between the 1.7–2.0s and 1.1–1.5s bands.
05Render the page shell on the server
If client-side JavaScript builds the first visible markup, FCP waits for the bundle to download, parse and run. Render the page shell on the server and stream slower parts in behind boundaries (Suspense in React, or the framework's equivalent). A static shell can paint as soon as the HTML arrives.
06Measure the critical request chain
The Lighthouse score alone won't tell you which band an app is in or why. To find out:
- Open Lighthouse's critical request chain, or the DevTools Performance panel at the FCP mark.
- List every request that has to finish before FCP.
- Count how many happen in sequence. That count predicts the band.
- Remove one, measure again, and repeat.
Things to check along the way:
- Requests to
fonts.googleapis.comorfonts.gstatic.comadd two steps. - A separate main stylesheet adds one.
- A slow HTML response on a cold cache means a server step.
- On Cloudflare, check whether the page came from the cache or was rendered again.
In one sentence
FCP goes up in steps, one for each request that has to finish in sequence: self-host and preload the font, inline the CSS, cache the data and the HTML, and render the shell on the server, and each change moves the app down a band.
Caveats
For LCP, TBT, CLS and per-host numbers on every port, see Benchmark. To see which of these features each framework documents, use the capability matrix.