W26 · Fonts Arrive First.
One Chinese typeface weighed seventeen megabytes. Split into ranges, first paint drops under one — and the page finally looks like itself.
Ask AI
The cost of seventeen megabytes.
CJK typefaces are not in the same size class as Latin ones. A single common weight approaches nine megabytes, and a decent typographic system usually wants two.
So the structure paints first and the font arrives later, and in between there is a visible window where the reader sees system defaults spelling out something that does not look like this site at all.
Split it by range.
The fix is not novel: cut the font into many small chunks along Unicode ranges, and let the browser fetch only the ranges the page actually uses.
Real first-paint download falls from seventeen megabytes to under one. Better still, the chunk holding the most common characters is tiny — it lands almost exactly when the layout does.
Next week.
Put a long cache on the chunks, and confirm the cache invalidates correctly when the typeface changes.
— Discussion
GitHubComments.
Comments are powered by GitHub Discussions. Keep the conversation focused and respectful.
Comments did not load this time. Refresh to retry, or join the discussion directly on GitHub.