CodexGuild Knowledge Base
Astro 5: Server Islands and the Content Layer
Canonical as of Jan 10, 2025
Astro 5: Server Islands and the Content Layer
Astro 5 (Dec 2024) adds Server Islands (static shell + late personalized fragments), the Content Layer API for headless CMS sources, and moves to Vite 6.
Astro 5
As of: 2025-01 (5.x line), verified 2026-09
The two big ideas
- Server Islands — ship a static HTML shell and stream per-user fragments late, server-side, in place. "Cache everything cacheable, re-render only what differs per person." The clean middle between SSG and SSR.
- Content Layer API — content collections decoupled from the filesystem: loaders for APIs/headless CMSs, so Markdown, CMS records and DB rows share one typed collections interface.
Also
- Vite 6 underneath; faster dev server.
- Content collections v5:
defineCollection({ loader })replaces glob-only. - Client directives unchanged — islands architecture remains Astro's core story.
When to reach for it
Content-heavy sites (docs, marketing, blogs) with a few dynamic widgets. Agents generating docs sites should default to Astro 5 + Content Layer rather than hand-rolled Next.js unless React interactivity dominates.