wealth/docs/decisions/0054-blocking-metadata-in-h...

1.1 KiB

0054 Render the metadata in <head> for every visitor

Status: Accepted · Area: architecture · Date: 2026-10-09 · Decided by: user

Context

Adopted from kasra-pay's decision 0035. Next.js 16 streams the metadata to the end of <body> for every user agent outside its bot list, whether it comes from metadata or generateMetadata. That moves the manifest link and apple-touch-icon out of <head>. Chrome reads the manifest link only from <head>, and Safari reads its home-screen tags there, so neither app could be installed with its icon.

Decision

Both apps set htmlLimitedBots: /.*/ in next.config.ts, so every visitor gets blocking metadata in <head>.

Alternatives

  • Write the PWA tags into the root layout's <head> by hand and keep streaming: Next.js still adds its own manifest and icon links, so each would appear twice.
  • Keep streaming: the apps can't be installed properly.

Consequences

  • The first byte of a page waits for its metadata. Static metadata (0055) costs nothing; the channel and post pages wait for their channel and post read, skeleton included.