Performance: Structured data (JSON-LD)
LOW IMPACT
Structured data affects page load speed slightly by adding script tags but mainly impacts SEO and rich results, not visual rendering.
import Head from 'next/head' export default function Page() { const jsonLd = { "@context": "https://schema.org", "@type": "Organization", "name": "Example" }; return ( <> <Head> <script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }} key="jsonld" /> </Head> <h1>Welcome</h1> </> ) }
export default function Page() { return ( <> <script type="application/ld+json"> {`{ "@context": "https://schema.org", "@type": "Organization", "name": "Example" }`} </script> <h1>Welcome</h1> </> ) }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Embedding JSON-LD as React children | Multiple text nodes created | 0 | Minimal but increased parsing time | [X] Bad |
| Injecting JSON-LD via Next.js Head with dangerouslySetInnerHTML | Single script node | 0 | Minimal parsing cost | [OK] Good |