An archive feed that doesn’t wait for WordPress

The first page arrives with the HTML, the next one is already fetched, and WordPress sees one request per query per publish.

Engineering
Headless
Performance
NP–86 · Engineering

The archive feed used to render entirely in the browser. The page loaded, asked WordPress for posts, then pushed the footer down when they arrived. On the blog that layout shift scored 0.594, well past the 0.1 that counts as good.

The first page comes with the HTML

The server now fetches the first page of posts while it builds the page, so the cards are in the HTML. Layout shift on the blog is 0.

Every click after that

What WordPress sees

Three visitors asking for the same filtered page now cost WordPress one request. A cached answer took about 3 ms on a local production build, against about 95 ms when the browser asked WordPress directly.

Answers carry only what a card shows, which took the blog page’s HTML from 18.7 KB to 12.4 KB.

Loading without a spinner

If an answer takes longer than 150 ms, grey cards in the shape of the real ones hold the space. Faster answers swap straight in, so most clicks never show a loading state at all.