Why Astro + Sanity wins on SEO
Static HTML, structured metadata, canonical URLs, and edge caching — a perfect score explained.
Static HTML is king
Search engines prefer pages that are fast, stable, and crawlable. Astro outputs pure static HTML — no JavaScript needed to see your content. Every heading, paragraph, and link is available to crawlers on the first response byte. Server-side rendering with hydration delays exposes content only after a JavaScript round-trip, which disadvantages it even with modern crawlers.
Structured metadata
Every page in this stack has full control over its title, meta description, Open Graph image, canonical URL, and noIndex flag. These are managed as structured fields in Sanity — not as free-text inputs or plugin settings — which means they can be validated, defaulted, and queried. The SEO component falls back through a chain: page-level fields → site defaults → static fallbacks, so no page is accidentally left untagged.
Edge caching
Cloudflare Pages serves every asset from the CDN edge — there is no origin server for static files. Time to first byte is sub-100ms from almost anywhere in the world. Google's Core Web Vitals, particularly LCP (Largest Contentful Paint) and TTFB, are directly improved by edge delivery.
A perfect score
Running Lighthouse against a production Astro + Sanity site on Cloudflare Pages routinely produces scores of 100 across Performance, Accessibility, Best Practices, and SEO. This is not an optimisation exercise — it falls out naturally from the architecture. No plugin, no page builder overhead, no third-party render-blocking script by default.