Skip to content
Shahariar Niloy, home

Measure the HTML, not just the bundle

What I learned from sending each page only the translations it actually uses.

Performance2 min readBy Shahariar Niloy

We all watch JavaScript bundle size. Far fewer people watch what’s embedded inside the HTML — and that’s often what arrives before the page can render.

The hidden cost

In a multilingual app, interactive components need their text on the very first render. The easy fix is to embed the whole translation dictionary in every page. It works, and it quietly puts tens of kilobytes of compressed text into every response — to show a few hundred strings.

Send only what the page uses

The mistake

My first version preloaded the full dictionary at low priority. On a throttled phone it still competed with the largest image and pushed Largest Contentful Paint back by more than a second and a half. After load, at idle, the cost disappeared.

The bytes that arrive before the page can render matter most — and they’re the easiest to forget.

Case study: Only the words a page needs
Next postA monthly performance review that actually works