# Next.js vs Astro: choosing a web framework for your product

> Next.js and Astro are built for different jobs. A practical comparison of rendering, performance, SEO, AI crawlers, hosting and team fit, with scenarios.

- Published: 2026-11-05; last updated 2026-11-13
- Author: the WeStack AI team
- Subject: Product engineering
- Address: https://westack.ai/blog/nextjs-vs-astro

> Choose Astro when the pages are mostly content: marketing sites, blogs, documentation. Choose Next.js when the product behaves like an application, with logged-in users, shared state and many interactive screens. Plenty of companies need both, and running the public site on Astro and the app on Next.js is a sound arrangement.

## Two frameworks built for different jobs

Astro is a content-first framework. A page is HTML and CSS unless you ask for more, and interactive pieces are added one component at a time. The current major version is [Astro 7](https://astro.build/blog/astro-7/), released in June 2026, with 7.4 following in October. Astro joined Cloudflare in January 2026 and remains MIT-licensed, with a public commitment to keep supporting other hosts.

Next.js is a full-stack React framework. A page is a tree of React components, some rendered on the server and some in the browser, with routing, data fetching and caching built in. The current major version is 16, released in October 2025, and [Next.js 16.4](https://nextjs.org/blog/next-16-4) arrived in October 2026.

Both can build a blog and both can build a dashboard. The difference is which one fights you. We use both, and the site you are reading runs on Astro, because it is made of pages people read.

## How does each one render a page?

Four terms cover most of it.

**Static** means the HTML is produced once, at build time, and served from a CDN. This is Astro's default: pages, routes and endpoints are prerendered unless you opt out.

**Server rendering** means the HTML is produced when the request arrives, so it can differ per visitor. Astro calls this on-demand rendering, and it needs an adapter for your host. In Next.js it is the normal mode for anything that reads cookies, headers or live data.

**Islands** are Astro's model for interactivity. The page stays static HTML and each interactive component is [an island that hydrates on its own](https://docs.astro.build/en/concepts/islands/), when and if you say so:

```astro
---
import PricingCalculator from '../components/PricingCalculator.jsx';
---
<h1>Pricing</h1>
<p>This paragraph ships as HTML, with no JavaScript.</p>
<PricingCalculator client:visible />
```

The calculator's code loads when it scrolls into view. Nothing else on the page costs the browser anything. Server islands do the same for personalised fragments: mark a component with `server:defer` and the rest of the page is sent at once while that piece is rendered separately and slotted in.

**Server Components** are the Next.js model. Every component runs on the server by default and sends its output to the browser. Only files marked `'use client'` ship their JavaScript and become interactive. On top of this, the 16.x releases introduced Cache Components: you mark a component or function with `'use cache'`, Next.js prerenders and caches it, and everything unmarked runs at request time. One response can then carry a cached shell and stream the personalised parts into it. As of 16.4 the Next.js team recommends this model for every app, new projects get it by default, and it will be the default in version 17.

So the two start from opposite ends. Astro begins with no JavaScript and you add it. Next.js begins with a React application and you take away what the browser does not need.

## Performance and Core Web Vitals

Google's [Core Web Vitals](https://web.dev/articles/vitals) are the usual yardstick: Largest Contentful Paint within 2.5 seconds, Interaction to Next Paint of 200 milliseconds or less, and Cumulative Layout Shift of 0.1 or less, each measured at the 75th percentile of real page loads.

On content pages Astro reaches those numbers with little effort, because there is nothing to hydrate. The usual way to lose that advantage is island sprawl: every component marked to load immediately, or React and Vue islands on the same page, each pulling in its own runtime.

Next.js has more to do on first load, since React itself must arrive and hydrate the client components. Server Components reduce the amount of JavaScript, but a careless `'use client'` near the top of the tree turns a whole page back into a browser-rendered app. Where Next.js pulls ahead is the second click. Its client-side router prefetches the next screen, and the navigation and partial prefetching work in 16.3 and 16.4 is aimed at making server-rendered apps respond like single-page apps. For a product where people move between twenty screens in a session, that matters more than the first paint.

One 16.4 addition is worth knowing if you run content on Next.js: `ensureStatic` fails the build if a dynamic component slips into a route you meant to keep static. That class of accident, a single cookie read turning a cached page into a server-rendered one, is a regression we see often on Next.js content sites.

Judge either framework on field data from real users, not on a laptop Lighthouse run.

## Which is better for SEO and AI crawlers?

Search engines and AI assistants need the same thing: the content in the HTML that the server returns. Both frameworks deliver that by default.

The risk is content that only appears after JavaScript runs. Google renders JavaScript, so it copes. Many AI crawlers do not. Vercel and MERJ analysed crawler traffic in December 2024 and found that [none of the major AI crawlers rendered JavaScript](https://vercel.com/blog/the-rise-of-the-ai-crawler) at the time, with Google's Gemini crawler and AppleBot as the exceptions. That data is nearly two years old and we have not seen a primary source showing it has changed, so we build as though it still holds.

In Astro it is hard to get this wrong. In Next.js it is easy to get right and still possible to get wrong: a product description fetched in a client component after load will be invisible to those crawlers. The test takes ten seconds. Fetch the page with `curl` and search the response for a sentence from the body. If it is not there, an assistant cannot quote it. Our guide to [answer engine optimisation](https://westack.ai/blog/answer-engine-optimisation) covers the rest: structure, schema and what gets cited.

## Hosting, lock-in and team skills

### Hosting and lock-in

An Astro site in static mode is a folder of files and runs on any host. Add on-demand rendering and you need an adapter; Astro maintains them for Node.js, Netlify, Vercel and Cloudflare.

Next.js supports every feature when run as a Node.js server or in a Docker container, so self-hosting has always been possible. What was missing was a documented contract for other platforms. Version 16.2 added a [stable Adapter API](https://nextjs.org/blog/nextjs-across-platforms), designed with OpenNext, Netlify, Cloudflare, AWS Amplify and Google Cloud, plus a shared test suite. At the time of writing the verified adapters are Vercel's and Bun's, with Cloudflare and Netlify building theirs and offering their own integrations meanwhile.

In practice, lock-in comes less from the framework than from the platform features you lean on: image optimisation, edge functions, key-value stores, cache invalidation across regions. Run Next.js on several instances yourself and you take on keeping caches in step and applying security releases promptly. Since July 2026 Next.js has had a formal security release process with scheduled patches, which is welcome, and it means someone must own [the platform work](https://westack.ai/services/cloud). Decide who that is before choosing the host.

### Team skills and daily work

Next.js assumes React. Beyond that, the team has to hold a larger model in their heads: which code runs where, what is cached, where the loading boundaries sit. Experienced React teams absorb it in weeks. A team that mostly writes content pages will pay for the complexity without using it.

Astro asks for HTML, CSS and a little JavaScript. Components from React, Vue or Svelte work inside islands, so existing skills carry over, and typed content collections keep Markdown and CMS content honest. Designers and content-minded developers are productive quickly.

Two other things to weigh. If a mobile app is on the roadmap, React experience transfers to React Native, which we compare in [Flutter vs React Native](https://westack.ai/blog/flutter-vs-react-native). And both frameworks now ship support for AI coding agents, such as version-matched documentation in Next.js and an agent-aware background dev server in Astro, so neither is at a disadvantage there.

## Next.js vs Astro at a glance

| | Astro 7 | Next.js 16 |
|---|---|---|
| Built for | Content sites | Applications |
| Default output | Static HTML, prerendered at build | Server-rendered React, cached where you mark it |
| JavaScript sent by default | None | React plus your client components |
| Interactivity | Islands, in any UI library | React throughout |
| Personalised content | Server islands, on-demand routes | Server Components with streaming |
| Moving between pages | Full page loads by default | Client-side router with prefetching |
| Hosting | Any static host; adapters for Node.js, Netlify, Vercel, Cloudflare | Node.js or Docker anywhere; Vercel; other adapters maturing |
| Team needs | HTML, CSS, some JavaScript | Strong React and server-side experience |
| Typical failure | Islands multiply until the page is an app in disguise | Whole pages drift to client rendering; caching misunderstood |

## Three scenarios

**A company site, blog and documentation.** A B2B software firm has about 200 pages, a pricing calculator and a demo request form. Use Astro. The pages are static, the calculator is one island, the form posts to an endpoint. It will be quick with no tuning and cheap to host.

**A SaaS product behind a login.** Dashboards, role-based access, forms that save as you type, notifications. Use Next.js. Nearly every screen is interactive and depends on who is signed in, navigation speed matters more than first load, and nobody needs these pages indexed. For an internal tool with a small audience, a plain React single-page app is also a fair choice.

**A storefront with personalisation.** Thousands of product pages that must rank, plus a basket, regional pricing and recommendations. This one depends on the team. A React team should use Next.js with Cache Components: product content cached, price and basket streamed in. A team without React depth can go a long way with Astro and server islands while the personalised parts stay small. We lean towards Next.js when checkout and account areas live in the same codebase.

Other choices are reasonable too. SvelteKit and Nuxt make the same trade as Next.js for Svelte and Vue teams. React Router in framework mode and TanStack Start, which reached 1.0 in October 2026, suit React teams that want less framework. For pure content with no interactivity at all, a static generator such as Eleventy or Hugo still does the job.

## How to decide in your first week

1. List your page types and mark each one content or application. If nearly all fall on one side, you have your answer. If they split, plan two codebases.
2. Build one real page of each type in the candidate framework, with real copy and real data.
3. Measure the JavaScript each page sends, and run the `curl` test on the content pages.
4. Decide where it will be hosted and who patches it, before writing features that depend on the platform.
5. Write down the one thing that would make you switch, and check it again in six months.

If you want help choosing or building, this is everyday work for our [product engineering team](https://westack.ai/services/product-engineering).

## Frequently asked questions

### Is Astro better than Next.js for SEO?

Both can rank well because both send server-rendered HTML. Astro makes it harder to get wrong, since content is static HTML by default and JavaScript is opt-in. With Next.js, keep content in Server Components and avoid loading it in the browser after the page arrives. In either case, check that the raw HTML response contains the text you want indexed.

### Can I use React components in Astro?

Yes. Astro renders React, Vue, Svelte and other components to HTML at build time and only sends their JavaScript when you add a client directive such as client:visible. That makes it practical to reuse a design system or a few interactive widgets from a React product on a content site without shipping a full React application to every page.

### Should the marketing site and the app use the same framework?

Not necessarily. Many teams run the public site on Astro and the logged-in product on Next.js, on separate subdomains with a shared design system. Each codebase stays simple and can be deployed on its own schedule. Use one framework for both only when the team is small, already fluent in React, and the content side is modest.

### Is Next.js tied to Vercel?

No. Next.js runs with full feature support as a Node.js server or in a Docker container on any host. Since version 16.2 it also has a stable Adapter API, developed with Netlify, Cloudflare, AWS Amplify, Google Cloud and OpenNext, so other platforms can support it against a shared test suite. Vercel remains the route with the least setup.
