Performance: Open Graph and social metadata
This affects the initial page load speed and how quickly social platforms can generate rich previews when sharing links.
<head> <meta property="og:title" content="Page Title" /> <meta property="og:description" content="Page description here." /> <meta property="og:image" content="/images/preview.png" /> </head>
<head>
<script src="https://external-social-meta.com/metadata.js"></script>
</head>| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| External social metadata script | Adds DOM nodes after load | Triggers multiple reflows | Increases paint cost due to delayed content | [X] Bad |
| Inline Open Graph meta tags | No additional DOM nodes beyond head | No reflows triggered | Minimal paint cost | [OK] Good |
og: tags in an Astro page's <head> section?og: tagsog: tags are Open Graph tags used to define how content is displayed on social media.<head> and control preview title, image, and description on social platforms.og: tags shape social media previews [OK]og: tags with CSS or fonts<head> section<head> section?name="twitter:..." attribute, not property.<meta name="twitter:title" content="..." />. Attribute order does not affect validity but standard is name then content.<head> snippet:<meta property="og:title" content="Welcome" /> <meta property="og:description" content="Best site" /> <meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:title" content="Welcome" />
<meta name="twitter:title" content="Welcome" /> sets the Twitter card title.twitter:title tag over Open Graph og:title if present.<head>:<meta property="og:image" content="/images/preview.png">
property attribute and closing is optional in HTML5; the main issue is the relative URL.content URL is relative; it should be an absolute URL -> Option C<head>?property="og:...", Twitter tags use name="twitter:...".property for og tags and name for twitter tags with matching content -> Option BPass the test and this pattern moves unknown