DEV Community

Daniel Pertu
Daniel Pertu

Posted on

Our page titles arrive 32 nodes into the head, after ten font preloads and fourteen scripts

Nobody reads the <head>. It is assembled by a framework from a metadata object, it works, and you move on. I had never actually counted what ours contains, so I downloaded all 76 public pages of Nakodo and parsed every node between <head> and <body>.

curl -s https://nakodo.app/sitemap.xml \
  | grep -o '<loc>[^<]*</loc>' | sed 's/<[^>]*>//g' > urls.txt
while read u; do
  curl -s -H 'Accept-Encoding: identity' "$u" -o "$(echo "$u" | tr '/:' '__').html"
done < urls.txt
Enter fullscreen mode Exit fullscreen mode

36 MB of HTML later, here is what the heads hold.

The census

Node Total across 76 pages Per page
meta 2,000 26 or 29
link 1,354 17 or 18
script 1,139 15
title 76 1
Total 4,569 47 to 62

410,503 bytes of head in total, a median of 5,508 bytes a page, which is 1.10% of the median page. No <style>, no <base>, no <noscript> and no JSON-LD in any of the 76 heads: the structured data lives in the body, and the two stylesheets are external on every page.

The 1,354 links break down as 816 preloads (740 of them fonts), 152 stylesheets, 152 icons, 76 manifests, 76 canonicals, 76 apple-touch-icons and 6 RSS alternates, which are exactly the blog index and its five posts.

Where the title sits

On 72 of the 76 pages, <title> is the 32nd node in the head. The first 31 are platform plumbing:

 1 <meta charSet="utf-8">
 2 <meta name="viewport" content="width=device-width, initial-scale=1">
 3..12  <link rel="preload" as="font" ...>   (ten woff2 files)
13..14  <link rel="stylesheet" ...>
15 <link rel="preload" as="script" fetchPriority="low" ...>
16..29  <script src="..." async>             (fourteen chunks)
30 <meta name="next-size-adjust" content="">
31 <meta name="theme-color" content="#f9f5ed">
32 <title>
Enter fullscreen mode Exit fullscreen mode

That is roughly 3.4 KB before the document says what it is. It costs nothing in rendering terms, because the parser reads the whole head before it paints, but it is a good reminder of who is actually writing your head: of 4,569 nodes, 1,139 are script tags that no line of my code asked for.

There are exactly seven distinct node orders across 76 pages, driven entirely by how much metadata each page adds to the layout's:

Pages Nodes What they are
58 61 registry content pages with keywords and article dates
8 57 hub pages such as /about and /glossary
5 62 blog posts, which add the RSS alternate
2 56 /privacy and /terms
1 58 the blog index
1 48 the home page
1 47 the pricing page

The 26 meta tags

Every page carries the same 23, and 63 of them carry three more:

76  charset, viewport, next-size-adjust, theme-color, description, application-name
76  og:title, og:description, og:url, og:site_name, og:locale, og:type
76  og:image, og:image:width, og:image:height, og:image:alt
76  twitter:card, twitter:title, twitter:description
76  twitter:image, twitter:image:alt, twitter:image:width, twitter:image:height
63  keywords, article:published_time, article:modified_time, article:author
Enter fullscreen mode Exit fullscreen mode

Ten tags describe the social card, seven more repeat most of it for Twitter, and the card itself is generated per page: the home page points at /opengraph-image and the rest at /og/<path>, which answer in 96 to 247ms with 38 to 59 KB of PNG.

Four things in that list deserve more attention than they have had.

og:locale says en_US

// src/app/layout.tsx
openGraph: { type: "website", siteName: BRAND.name, locale: "en_US" },
Enter fullscreen mode Exit fullscreen mode

The same string is hardcoded again in src/lib/seo/metadata.ts. This site is written in British English, prices in pounds by default, and spells "colours" in its own design notes. The locale is a copy-paste that has been on all 76 pages since the first deploy, and the only reason nothing broke is that almost nothing reads og:locale.

keywords is on 63 pages

keywords: how to find youtube influencers,find youtubers to sponsor,...
Enter fullscreen mode Exit fullscreen mode

Search engines stopped using the keywords meta before some of my dependencies existed. It is on 63 pages because our content registry has an optional keywords?: string[] field and page authors filled it in. It is not harmful, it is 63 pages of text that no client reads, and it is the clearest example I have of a field surviving because the type allowed it.

article:modified_time is the same date on all 63

63  article:modified_time  2026-10-03
32  article:published_time 2026-10-03
31  article:published_time 2026-10-02
Enter fullscreen mode Exit fullscreen mode

I already knew our sitemap claims every page changed on 3 October and that 30 of them changed later. This is the same stale date leaking out of a second hole: the registry's updated field feeds both. One fix repairs both.

Nothing says robots, author, generator or hreflang

Zero meta name="robots" across 76 pages, zero hreflang, zero twitter:site, zero author. The robots absence is correct, because robots.txt and the sitemap do that work and a missing robots meta means "index, follow" anyway. hreflang is correct too, for a single-language site, though it is funny next to a hardcoded en_US.

The two pages with no font preloads

74 pages preload ten woff2 files each. Two pages preload none: the home page and the pricing page.

pages with 10 font preloads: 74
pages with 0 font preloads:   2   (/ and /pricing)
Enter fullscreen mode Exit fullscreen mode

Those two are also the only two pages on the site that are dynamically rendered, because both read a request header to decide which currency to print. A route that is not prerendered does not get the font preload links emitted into its head, and so the two pages that cannot be cached are also the two that do not spend 3.7 seconds of a slow connection on font preloads before first paint. I measured that cost on this site a few days ago and concluded the preloads were hurting us; it turns out the two most important pages have been quietly opted out of them all along.

I am not sure whether that is a deliberate framework behaviour or a side effect, and the honest answer is that I only found it by counting.

What I am changing

  1. en_US becomes en_GB in both files, with a test that the string appears exactly nowhere else.
  2. keywords comes out of the registry type. If a field only exists because nothing stops it, deleting the field is the fix, not deleting the values.
  3. article:modified_time gets the same repair as the sitemap's lastmod, since they read the same column.
  4. The font preload asymmetry gets investigated rather than assumed, because "our two best pages are faster by accident" is not a strategy.

Everything above is measurable from outside. Pick any page in our sitemap, view source, and count to 32.

Top comments (0)