Astro 5 vs Next.js 15: Complete Technical Comparison 2026
For headless WordPress, Astro 5 is faster and cheaper for content: 0 KB JS, PageSpeed 98-100, TTFB 10-40 ms, LCP 0.4-1.2 s, and hosting on Cloudflare Pages. Choose Next.js 15 (~85-150 KB React) for login, cart, and app state.
Below: Core Web Vitals table, CDN vs Node.js hosting costs, and a decision matrix from our Headless WordPress projects.
Which Astro and Next.js versions this comparison covers
This comparison describes Astro 5 and Next.js 15, the majors it was written for. Astro 5.0 was published on npm on 3 December 2024 and its last 5.x release, 5.18.2, on 26 May 2026. Next.js 15.0 came out on 21 October 2024, and the 15.x line still receives patch releases: 15.5.28 was published on 14 October 2026. The dates come from the time field of the astro and next entries in the npm registry.
Both projects have moved on. On 14 October 2026 the current releases are Astro 7.3.8 and Next.js 16.4.1. The architectural split described below holds for the newer majors as well: Astro renders static HTML and hydrates islands on request, Next.js renders a React application built on Server Components. The two sections near the end, on Astro 6 and 7 and on Next.js 16, list the changes that affect the code samples in this article.
Astro islands vs Next.js React Server Components
To understand why these frameworks perform so differently, we must look at their core design decisions.
How the islands architecture works in Astro 5
Astro was designed specifically for content-driven websites (blogs, documentation, portfolios, marketing, and corporate sites). Its foundational mental model is that a website should be static HTML by default, with client-side JavaScript injected only when and where interactivity is required.
┌──────────────────────────────────────────────┐
│ Static HTML Header │
├──────────────────────────────────────────────┤
│ Static Sidebar │
│ │
│ ┌─────────────────────────┐ │
│ │ React Island │ < Loaded │
│ │ (Interactive Cart) │ on demand │
│ └─────────────────────────┘ │
│ │
│ Static Content │
├──────────────────────────────────────────────┤
│ Static HTML Footer │
└──────────────────────────────────────────────┘Astro achieves this through the Islands Architecture (also known as component islands). In Astro, every component is rendered to static HTML on the server during the build process. If you write a component using React, Vue, or Svelte, Astro compiles it to raw HTML and strips out the framework’s runtime library. If the component needs to be interactive on the client, you apply a client: directive (such as client:visible or client:only="react"). Only then does Astro ship the runtime JavaScript and hydrate that specific component.
Astro 5 also introduces a unified Content Layer that allows you to treat data from remote APIs (like Headless WordPress, content databases, or local Markdown) as a local queryable collection, optimized for caching and fast compilation.
How React Server Components work in Next.js 15
Next.js 15 was designed for dynamic, interactive web applications (SaaS dashboards, social networks, complex portals, and e-commerce platforms). Its foundational mental model is that a website is a single unified React application, where code is split between the server and the client to optimize delivery.
With the App Router, Next.js utilizes React Server Components (RSC) by default. RSCs render entirely on the server. Unlike traditional server-side rendering (SSR), they do not send their component code or React state to the client, nor do they hydrate on the client.
However, because Next.js assumes a React-centric runtime environment, it still sends a baseline React framework runtime bundle (~85KB to 150KB) to boot the application shell and handle routing, context, and client-side page transitions.
In Next.js 15, the experimental Partial Prerendering (PPR) flag, available on canary releases, lets developers combine static shells with dynamic holes. A static page layout can be compiled and sent to the user instantly, while dynamic sections wrapped in React <Suspense> boundaries are streamed down as they finish resolving on the server. Next.js 16 replaced the flag with cacheComponents.
Astro vs Next.js performance and Core Web Vitals
In the SEO landscape of 2026, Core Web Vitals (LCP, INP, TTFB) are critical ranking factors. A delay of 500ms can directly hurt your search placement and conversion rate.
| Performance Metric | Astro 5 | Next.js 15 |
|---|---|---|
| Default JS Shipped | 0 KB | ~85 KB - 150 KB (React shell) |
| Typical PageSpeed Mobile | 98-100 | 85-95 |
| TTFB (Static Content) | 10ms - 40ms | 25ms - 75ms |
| Largest Contentful Paint (LCP) | 0.4s - 1.2s | 0.8s - 2.2s |
| Interaction to Next Paint (INP) | < 30ms (Excellent) | 50ms - 150ms (Good to Fair) |
| Build Time (1,000 pages) | 20s - 45s (Vite-based) | 45s - 120s (Webpack/Turbopack) |
| Client-Side Framework Support | React, Vue, Svelte, Preact, Solid, Vanilla | React Only |
Why Astro 5 is faster on content sites
Because Astro ships zero JavaScript by default, the browser doesn’t have to parse, compile, and execute large framework runtimes before the page becomes interactive.
- LCP is faster because the initial HTML contains the fully rendered structure and inline styles. The browser can paint the primary image or text immediately.
- INP is near-zero because there is no hydration phase blocking the main thread. If a user clicks a static link or scrolls, the browser handles it natively without waiting for React to bind event listeners.
- Low Network Payload: Astro pages are extremely lightweight, making them load fast even on weak 3G/4G connections common in mobile environments.
When is Next.js 15 better than Astro
While Next.js has more initial overhead, its performance for complex, highly stateful client-side interactions is exceptional:
- Subsequent Page Loads: Once the React bundle is loaded, navigating between routes is handled client-side via React’s router. Only the page data (JSON or RSC payload) is fetched, making transitions feel instantaneous.
- State Retention: Since the entire tree is React, sharing state between the sidebar, header, and main panel is straightforward using React Context or state libraries (Zustand, Redux). In Astro, sharing state between separate islands requires custom events or external nanostores, which adds architectural complexity.
Headless WordPress with Astro or Next.js
Both frameworks are popular choices for Headless WordPress. Here is how they approach data fetching and content synchronization.
How to load WordPress data with the Content Layer API in Astro 5
Astro 5 features the Content Layer API. Instead of fetching raw API data on every page layout, you define a collection in src/content.config.ts and fetch the posts during the build stage. Astro saves the loaded entries to a persistent data store, the storage layer the content collections guide describes for build-time collections.
Here is a typical schema definition for Headless WordPress posts in Astro:
// src/content.config.ts
import { defineCollection, z } from 'astro:content';
const blog = defineCollection({
loader: async () => {
const res = await fetch('https://wp.yoursite.com/wp-json/wp/v2/posts?_embed&per_page=100');
const posts = await res.json();
return posts.map((post: any) => ({
id: post.slug,
title: post.title.rendered,
content: post.content.rendered,
date: post.date,
heroImage: post._embedded?.['wp:featuredmedia']?.[0]?.source_url || '/placeholder.jpg'
}));
},
schema: z.object({
id: z.string(),
title: z.string(),
content: z.string(),
date: z.string(),
heroImage: z.string().optional(),
}),
});
export const collections = { blog };And in the Astro page component, you render this statically:
---
// src/pages/blog/[slug].astro
import { getCollection, getEntry } from 'astro:content';
export async function getStaticPaths() {
const posts = await getCollection('blog');
return posts.map(post => ({
params: { slug: post.id },
props: { post },
}));
}
const { post } = Astro.props;
---
<Layout title={post.data.title}>
<article>
<h1>{post.data.title}</h1>
<img src={post.data.heroImage} alt={post.data.title} />
<div set:html={post.data.content} />
</article>
</Layout>How to fetch WordPress data in Next.js 15 with fetch cache
Next.js 15 relies on React Server Components to fetch data directly from WordPress using the native fetch API, which Next.js extends with request-deduplication and fine-grained cache revalidation tags.
// app/blog/[slug]/page.tsx
import { notFound } from 'next/navigation';
interface WPPost {
title: { rendered: string };
content: { rendered: string };
slug: string;
}
// Fetch single post from WordPress
async function getPost(slug: string): Promise<WPPost | null> {
const res = await fetch(`https://wp.yoursite.com/wp-json/wp/v2/posts?slug=${slug}`, {
next: {
revalidate: 3600, // Cache for 1 hour (ISR)
tags: ['posts', `post-${slug}`]
}
});
const posts = await res.json();
return posts[0] || null;
}
export default async function BlogPostPage({ params }: { params: Promise<{ slug: string }> }) {
const { slug } = await params; // params is a Promise since Next.js 15
const post = await getPost(slug);
if (!post) {
notFound();
}
return (
<article className="max-w-4xl mx-auto py-8">
<h1 className="text-4xl font-bold">{post.title.rendered}</h1>
<div
className="prose mt-6"
dangerouslySetInnerHTML={{ __html: post.content.rendered }}
/>
</article>
);
}Next.js ISR vs Astro SSG for WordPress content
- Next.js Incremental Static Regeneration (ISR) is highly dynamic. If an editor publishes a post in WordPress, Next.js can receive a webhook to purge the cache tag (
revalidateTag('posts')), regenerating that specific page instantly without building the rest of the site. - Astro 5 traditionally uses Static Site Generation (SSG). When an editor publishes a post, a webhook triggers a new build. For sites with under 5,000 pages, this build takes less than a minute, which is fast enough for most publishing flows. For larger sites, Astro 5 merged the former
hybridoutput intostatic, so with an adapter installed single routes can render on demand instead of at build time, which suits previews and dynamic sections (Astro 5 upgrade guide).
Astro vs Next.js developer experience
A developer’s productivity is directly linked to the framework’s DX and ecosystem support.
Using React, Vue or Svelte in Astro
Astro’s biggest advantage is its framework-agnostic nature. You are not forced to write React. If a team is skilled in Svelte or Vue, they can build components in their preferred library and drop them directly into Astro layouts.
Additionally, because Astro uses raw HTML/CSS conventions, the learning curve for junior developers is incredibly low compared to learning React hooks, context, server components, and state management.
Does Next.js only work with React
Next.js is strictly React. If you want to use Next.js, you must write React. However, because React is the most popular frontend library in the world, the ecosystem is massive. You have access to thousands of UI libraries (shadcn/ui, Radix, Material UI), animation frameworks (Framer Motion), and state libraries designed explicitly for React.
For developers who are already experts in React, Next.js 15 offers a mature, fully integrated ecosystem.
Astro vs Next.js hosting costs
Deploying static and dynamic workloads carries different structural costs.
How much does Astro hosting cost
Because Astro compiles to static HTML, CSS, and JS files by default, it does not require a Node.js server. You can host Astro sites on global edge networks like Cloudflare Pages, Netlify, or GitHub Pages for free or near-free:
- No CPU compute costs for static page loads.
- Extremely low bandwidth costs because CDNs distribute static files efficiently.
- Zero server maintenance, security patching, or container orchestrations.
How much does Next.js hosting cost
If you use Next.js with its full feature set (dynamic server-side rendering, streaming, server actions, and active ISR), you need an environment capable of running Node.js or edge runtime functions:
- Vercel provides the best zero-config experience, but bandwidth and serverless execution costs scale rapidly with traffic.
- Self-hosting Next.js on AWS or DigitalOcean requires running a Node.js server in a Docker container, requiring active server management, scaling policies, and load balancers.
- Using adapters like OpenNext allows you to host Next.js on Cloudflare Workers, but mapping features like ISR to edge key-value stores introduces additional infrastructure complexity.
When to use Astro vs Next.js
To choose the right framework for your project, go through this 8-point checklist:
- Is 80%+ of the website static content (marketing, blog, catalog)?
- Yes: Choose Astro.
- No: Choose Next.js.
- Does the site require user authentication and personalized user dashboards?
- Yes: Choose Next.js.
- No: Choose Astro.
- Is mobile performance and SEO page speed the primary business KPI?
- Yes: Choose Astro.
- No: Choose Next.js.
- Are you building a complex SaaS application with frequent real-time state changes?
- Yes: Choose Next.js.
- No: Choose Astro.
- Does your development team have diverse framework preferences (Vue, Svelte, React)?
- Yes: Choose Astro.
- No: Choose Next.js.
- Do you want to host your website for free on a global CDN like Cloudflare Pages?
- Yes: Choose Astro.
- No: Choose Next.js.
- Do you need to support massive e-commerce features with real-time stock updates?
- Yes: Choose Next.js.
- No: Choose Astro.
- Is the backend a Headless WordPress installation where speed is the main objective?
- Yes: Choose Astro.
- No: Choose Next.js.
What changed in Astro 6 and Astro 7 for a WordPress frontend
The Astro 6 upgrade guide lists these changes that touch a headless WordPress build:
- Node 18 and Node 20 are no longer supported. Astro 6 needs Node 22.12.0 or higher.
- Vite moves to version 7 and Zod to version 4, so custom Zod schemas in
src/content.config.tsmay need changes. - The legacy Content Collections API is removed. Every collection has to use the Content Layer API with a loader, as in the WordPress example above.
Astro.glob()is removed in favour ofimport.meta.glob().- Live content collections, the CSP configuration under
security.cspand the fonts API are stable.
Live collections matter for WordPress. The content collections guide says they fetch data at runtime instead of at build time, are defined in src/live.config.ts and return data directly instead of writing it to the data store. A post edited in WordPress can then appear without a rebuild, which narrows the gap to Next.js ISR described earlier.
The Astro 7 upgrade guide adds Vite 8, a Rust-based compiler that replaces the Go-based one and is stricter about invalid HTML syntax, a new compressHTML default of 'jsx', stable route caching and the removal of the @astrojs/db package. Markup in .astro templates that the old compiler tolerated can fail the build after the upgrade, so the strict compiler is the first thing to test.
What changed in Next.js 16 for a WordPress frontend
The Next.js 16 upgrade guide lists these changes relevant to the code in this article:
- Synchronous access to
params,searchParams,cookies(),headers()anddraftMode(), which Next.js 15 still allowed as a temporary compatibility mode, is removed. The page component above already awaitsparams, as the Next.js 15 upgrade guide recommends. revalidateTagtakes a second argument with acacheLifeprofile, so the webhook handler callsrevalidateTag('posts', 'max'). For immediate expiry inside a Server Action the guide points to the newupdateTag.- Turbopack is the default bundler for
next devandnext build. A project with a customwebpackconfiguration fails the build unless it passes--webpackor migrates that configuration. - The experimental PPR flag is removed. Partial prerendering is now enabled with
cacheComponents: true, and the guide warns that it works differently than in the Next.js 15 canaries. middleware.tsis renamed toproxy.ts. The proxy runs on the Node.js runtime only; projects that need the edge runtime keepmiddleware.- Node.js 20.9 is the minimum version, the
next lintcommand is removed and AMP support is gone.
Can Next.js export a static site like Astro
It can, with limits. Setting output: 'export' in next.config.js makes next build write HTML, CSS and JS files into an out folder that any static host can serve, according to the static exports guide. Server Components still run, but only during the build. The same guide lists what stops working: dynamic routes without generateStaticParams(), route handlers that read the request, cookies, rewrites, redirects, headers, proxy, Incremental Static Regeneration, image optimization with the default loader, Draft Mode and Server Actions.
For headless WordPress that list removes the two features that usually justify Next.js: ISR after a publish webhook and Draft Mode previews for editors. Route transitions in a static export still happen on the client, so the browser loads React as it would in a single-page application. If the site ends up static anyway, Astro produces the same kind of output without that runtime.
Astro covers the opposite direction. With an adapter installed, the server:defer directive turns a single component into a server island that is rendered on demand while the rest of the page stays static, and a child with slot="fallback" provides placeholder content (server islands guide). A logged-in header or a cart counter can sit on an otherwise static Astro page this way.
Conclusion
In 2026, the choice between Astro 5 and Next.js 15 is not about which framework is technically superior—it is about architectural fit.
Astro 5 is the king of content. It delivers unmatched performance, zero-JavaScript payloads, and minimal hosting costs. If you are building a corporate site, marketing page, blog, or standard Headless WordPress site, Astro is the optimal choice to secure top Core Web Vitals scores and organic search visibility.
Next.js 15 is the platform for applications. It provides a robust, highly integrated, full-stack React framework designed to handle user state, real-time sync, and interactive dashboards. If you are building a web application, a SaaS, or a dynamic e-commerce store with complex user routing, Next.js remains the industry standard.
For teams looking to migrate their legacy monolothic platforms, we recommend conducting a thorough architectural audit before writing the first line of code. If you need assistance planning a Headless WordPress migration or building with Astro, contact our development team for a technical assessment.







