Astro
Astro scores 24 of 28 points. That is 12 of 14 on the 7 features that affect first paint (the moment the browser first draws content), and 12 of 14 on the 7 other features.
- Version checked
- Astro 7.4.13 (npm latest on 2026-11-20; labels were drafted against 7.4.10, and the astro-books port locks 7.4.12)
- Performance guide
- Why Astro? | DocsNo dedicated performance page (docs.astro.build/en/guides/performance/ is 404); closest official page.
- Issues
- github.com/withastro/astro/issues
Scorecard
All 14 features, in two groups. Each row shows Astro's label, how that label compares across all 23 frameworks, and how to enable the feature. Feature names link to Astro's entry on that feature's page.
Astro's labels across 14 features
- 1st-party11
- Experimental0
- Third-party2
- Manual1
- of 14
How it compares
On 11 of 14 features, no framework has a higher-scoring label than Astro. On the other 3, at least one does.
Tested in our port
The astro-books port passes 11/11 feature tests. Run on 2026-11-26 at MaxwellCohen/astro-books@bdf27d7. How we test labels
First-paint levers
- 01Production CSS inlining1st-party2 pts
1st-party, like 7 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
build.inlineStylesheets: 'always' | 'auto' | 'never'(stable, astro@2.6.0+). Defaultautoinlines styles under 4kB and links larger ones;'always'inlines all. (configuration-reference, styling)Code example
build.inlineStylesheetscontrols whether project CSS ships as<style>tags or linked files.'always'inlines every stylesheet; the default'auto'inlines only files under Vite's 4kBassetsInlineLimit.// astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ build: { inlineStylesheets: 'always', // 'auto' (default) | 'never' }, });Source: Astro: configuration reference, build.inlineStylesheets
- 02Font optimization1st-party2 pts
1st-party, like 3 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
Fonts API: top-level
fontsconfig (astro@6.0.0+) plus<Font cssVariable preload />fromastro:assets, not under experimental flags. Providers include Google, Bunny, Fontsource, Fontshare, Adobe, local; fonts are downloaded, cached, served from_astro/fonts, with asubsetsoption (defaultlatin) and optimized fallbacks.preloaddefaults to false. (fonts, astro-assets)Code example
Register the font in the top-level
fontsconfig, then render<Font />in the layout head. Astro downloads and serves the files itself, andpreloadadds a preload link.// astro.config.mjs import { defineConfig, fontProviders } from 'astro/config'; export default defineConfig({ fonts: [{ provider: fontProviders.fontsource(), name: 'Roboto', cssVariable: '--font-roboto', }], });--- // src/layouts/Layout.astro import { Font } from 'astro:assets'; --- <html> <head> <Font cssVariable="--font-roboto" preload /> </head> <body><slot /></body> </html>Source: Astro: Using custom fonts
- 03Image pipeline1st-party2 pts
1st-party, like 8 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
<Image />fromastro:assetsoptimizes local and authorized remote images; Sharp is the default service; responsivelayout/srcsetsince astro@5.10.0;public/images are not optimized. Cloudflare, Vercel, and Netlify adapters have host image services. (images, cloudflare, vercel, netlify)Code example
<Image />fromastro:assetsresizes and converts imported local images at build time.layout="constrained"adds a responsivesrcset, andimage.domainslets remote images through the same pipeline.--- // src/components/Cover.astro import { Image } from 'astro:assets'; import cover from '../assets/cover.jpg'; --- <Image src={cover} alt="Book cover" layout="constrained" width={800} height={600} />// astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ image: { domains: ['covers.example.com'], }, });Source: Astro: Images
Art direction with <picture>
1st-partyServing a different crop or format per screen size. Not scored: the label shows how much the framework does for you.
<Picture />(astro@3.3.0+) emits<picture>withformats(defaultwebp) plus a fallback<img>. Breakpoint art direction is not in the component docs; the official recipe usesgetImage()and a hand-written<picture>/<source media>. (astro-assets, build-custom-img-component)Example
<Picture />handles formats, not breakpoints. Astro's recipe callsgetImage()once per crop and writes the<picture>by hand.--- // src/components/Hero.astro import { getImage } from "astro:assets"; import wide from "../assets/hero-wide.jpg"; import square from "../assets/hero-square.jpg"; const desktop = await getImage({ src: wide, width: 1600, format: "avif" }); const mobile = await getImage({ src: square, width: 600, format: "webp" }); const fallback = await getImage({ src: square, width: 600 }); --- <picture> <source media="(min-width: 768px)" srcset={desktop.src} type="image/avif" /> <source srcset={mobile.src} type="image/webp" /> <img src={fallback.src} {...fallback.attributes} alt="Shelves of books" /> </picture> - 04Data/HTML caching1st-party2 pts
1st-party, like 16 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
Route caching for on-demand pages (astro@7.0.0+): top-level
cache: { provider }withmemoryCache(),Astro.cache.set({ maxAge, swr, tags }),routeRules,cache.invalidate(). Host providers (cacheNetlify(),cacheVercel(),cacheCloudflare()) are experimental and manually enabled. Also Vercelisr: trueand NetlifycacheOnDemandPages. (caching, astro-7, vercel, netlify)Code example
Pick a cache provider in the config, then set cache options from an on-demand page.
routeRulessets defaults for groups of routes, andcache.invalidate()purges by tag or path.// astro.config.mjs import { defineConfig, memoryCache } from 'astro/config'; export default defineConfig({ cache: { provider: memoryCache() }, routeRules: { '/books/[...slug]': { maxAge: 3600, tags: ['books'] }, }, });--- // src/pages/index.astro export const prerender = false; Astro.cache.set({ maxAge: 120, swr: 60, tags: ['home'] }); ---// src/pages/api/revalidate.ts import type { APIRoute } from 'astro'; export const POST: APIRoute = async (context) => { await context.cache.invalidate({ tags: ['books'] }); return new Response(null, { status: 204 }); };Source: Astro: Route caching
- 05Route prefetching1st-party2 pts
1st-party, like 18 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
prefetch: trueadds the script; links opt in viadata-astro-prefetchorprefetch.prefetchAll: true. Strategieshover(default),tap,viewport,load; falls back totapon data saver.<ClientRouter />pages prefetch by default.eagernessand Speculation Rules need experimentalclientPrerender. (prefetch)Code example
prefetch: trueturns on the prefetch script. Links opt in withdata-astro-prefetchand a strategy, orprefetchAllcovers every link.// astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ prefetch: { prefetchAll: true, defaultStrategy: 'viewport', // 'hover' (default) | 'tap' | 'viewport' | 'load' }, });<!-- src/components/Nav.astro --> <a href="/books" data-astro-prefetch="tap">Books</a> <a href="/account" data-astro-prefetch="false">Account</a>Source: Astro: Prefetch
- 06Streaming SSR1st-party2 pts
1st-party, like 17 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
On-demand pages use HTML streaming: the document is sent in chunks, in order, as each component renders, so
<head>and the top of the page go out before a slowawaitfurther down finishes. Nothing to enable. Move slow fetches into child components so they do not block the parts above them;server:deferserver islands cover content that should arrive out of order. (on-demand-rendering)Code example
On-demand pages stream by default. Put a slow fetch in its own component: the HTML above it is sent while it waits.
--- // src/pages/books/[id].astro export const prerender = false; // render on demand import Layout from "../../layouts/Layout.astro"; import BookDetail from "../../components/BookDetail.astro"; import Reviews from "../../components/Reviews.astro"; --- <Layout title="Book"> <BookDetail id={Astro.params.id} /> <!-- head, header and BookDetail are already sent while Reviews awaits --> <Reviews id={Astro.params.id} /> </Layout>--- // src/components/Reviews.astro const res = await fetch(`https://api.example.com/books/${Astro.props.id}/reviews`); const reviews = await res.json(); --- <ul>{reviews.map((r) => <li>{r.text}</li>)}</ul>Source: Astro: On-demand rendering, HTML streaming, Astro: Streaming for page performance
- 07Early Hints / preload headersManual0 pts
Manual, like 15 of the other 22 frameworks. 7 frameworks score higher.
Show the how-toHide the how-to
No first-party preload
Linkheaders or 103 Early Hints documented; the configuration reference has no option for either. Set aLinkheader by hand withAstro.response.headersor at the host. (configuration-reference, on-demand-rendering)Code example
Set a
Linkheader on HTML responses in the middleware. This one preconnects to the font host. To preload a built file with a hashed name, read its URL from the Vite manifest.// src/middleware.ts import { defineMiddleware } from 'astro:middleware' const LINK = '<https://fonts.gstatic.com>; rel=preconnect; crossorigin' export const onRequest = defineMiddleware(async (_context, next) => { const response = await next() if (!response.headers.get('content-type')?.includes('text/html')) return response const headers = new Headers(response.headers) headers.set('Link', LINK) return new Response(response.body, { status: response.status, statusText: response.statusText, headers }) })Source: Astro middleware
Other features
- 08Islands / partial hydration / lazy slices1st-party2 pts
1st-party, like 14 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
Zero client JS by default;
client:load,client:idle,client:visible,client:media,client:only.server:deferserver islands need an adapter; props travel in an encrypted query string. Server islands were experimental in astro@4.12 (experimental.serverIslands) and the flag was removed in astro@5.0, where the feature is available without it; the guide carries no experimental label. (islands, framework-components, server-islands, upgrade-to/v5, astro-4120)Code example
Components render to HTML with no client JS unless a
client:*directive hydrates them.server:deferturns an Astro component into a server island that renders after the page, with fallback content until it arrives.--- // src/pages/index.astro import Counter from '../components/Counter.jsx'; import Avatar from '../components/Avatar.astro'; import GenericAvatar from '../components/GenericAvatar.astro'; --- <Counter client:visible /> <Avatar server:defer> <GenericAvatar slot="fallback" /> </Avatar>Source: Astro: Server islands
- 09Per-route render modes1st-party2 pts
1st-party, like 18 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
Default static;
export const prerender = falseper page/endpoint for on-demand rendering; withoutput: 'server',prerender = trueopts back in. On-demand pages need an adapter. (on-demand-rendering)Code example
Pages prerender by default.
export const prerender = falserenders one page on demand; withoutput: 'server',prerender = trueopts a page back into static output.--- // src/pages/[id].astro export const prerender = false; // render on each request (needs an adapter) const { id } = Astro.params; --- <h1>Book {id}</h1>Source: Astro: On-demand rendering
- 10Fine-grained client reactivity1st-party2 pts
1st-party, like 21 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
No reactivity of its own in
.astrocomponents; the official Astro-team integrations@astrojs/solid-js,@astrojs/svelte, and@astrojs/vue(installed withastro add) bring Solid signals, Svelte runes, and Vue refs to islands. (framework-components, solid-js, svelte, vue)Code example
.astrocomponents have no client state. Add a UI framework integration (here Solid viaastro add solid) and use its signals inside an island.// src/components/Counter.tsx import { createSignal } from 'solid-js'; export default function Counter() { const [count, setCount] = createSignal(0); return <button onClick={() => setCount(count() + 1)}>Clicked {count()}</button>; }--- // src/pages/index.astro import Counter from '../components/Counter'; --- <Counter client:load />Source: Astro: @astrojs/solid-js
- 11Built-in bundle analysisThird-party1 pt
Third-party, like 18 of the other 22 frameworks. 2 frameworks score higher.
Show the how-toHide the how-to
No first-party analyzer documented; the official recipe adds
rollup-plugin-visualizer, with a caveat that the report may not match what the client downloads. (analyze-bundle-size)Code example
Astro's recipe adds
rollup-plugin-visualizeras a Vite plugin.astro buildthen writesstats.html. The report covers the whole site, not each page.// astro.config.mjs import { defineConfig } from 'astro/config'; import { visualizer } from 'rollup-plugin-visualizer'; export default defineConfig({ vite: { plugins: [visualizer({ emitFile: true, filename: 'stats.html' })], }, });Source: Astro: Analyze bundle size
- 12Third-party script strategies1st-party2 pts
1st-party, like 4 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
Official
@astrojs/partytownintegration:astro add partytown, thentype="text/partytown"on scripts. (partytown)Code example
Install the integration with
npx astro add partytown, then mark scriptstype="text/partytown"so they run in a web worker.forwardexposes globals such asdataLayer.pushto the worker.// astro.config.mjs import { defineConfig } from 'astro/config'; import partytown from '@astrojs/partytown'; export default defineConfig({ integrations: [partytown({ config: { forward: ['dataLayer.push'] } })], });<!-- src/layouts/Layout.astro --> <script type="text/partytown" src="https://example.com/analytics.js"></script>Source: Astro: @astrojs/partytown
- 13Portable multi-host deployment1st-party2 pts
1st-party, like 7 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
Official adapters for Node (standalone/middleware), Vercel, Netlify, and Cloudflare; the on-demand rendering page names all four as official, and
astro add <adapter>installs them. (on-demand-rendering, deploy, node, vercel, netlify, cloudflare)Code example
The Books port picks an official adapter from the build environment and falls back to Node. Each adapter is installed with
astro add <name>.// astro.config.mjs import node from '@astrojs/node'; import { defineConfig } from 'astro/config'; async function pickAdapter() { if (process.env.NETLIFY) return (await import('@astrojs/netlify')).default(); if (process.env.CF_PAGES) return (await import('@astrojs/cloudflare')).default(); if (process.env.VERCEL) return (await import('@astrojs/vercel')).default(); return node({ mode: 'standalone' }); } export default defineConfig({ output: 'server', adapter: await pickAdapter(), });Source: Astro: @astrojs/node
- 14Service worker / offline supportThird-party1 pt
Third-party, like 2 of the other 22 frameworks. 2 frameworks score higher.
Show the how-toHide the how-to
No first-party service worker documented. The community
@vite-pwa/astrointegration (2.0.4) generates the worker and precache manifest with Workbox and registers it; the Astro docs do not mention it. (vite-pwa astro)Code example
Add the
@vite-pwa/astrointegration, which generates a Workbox worker and precache manifest at build time. Register it from the main layout.// astro.config.mjs (npm install -D @vite-pwa/astro) import { defineConfig } from "astro/config"; import AstroPWA from "@vite-pwa/astro"; export default defineConfig({ integrations: [AstroPWA({ workbox: { navigateFallback: "/404" } })], });--- // src/layouts/Layout.astro import { pwaInfo } from "virtual:pwa-info"; --- <head> <script src="/src/pwa.ts"></script> {pwaInfo && <Fragment set:html={pwaInfo.webManifest.linkTag} />} </head>// src/pwa.ts import { registerSW } from "virtual:pwa-register"; registerSW({ immediate: true });Source: Vite PWA: Astro
1st-party scores 2 points, Experimental and Third-party 1, Manual 0. How scoring works
The port
The books demo app built with this framework, and where each branch is deployed.
- App
- astro-books
- Repository
- github.com/MaxwellCohen/astro-books
Branch
main
vibe port
- Netlify
- max-astro-books.netlify.app
- Cloudflare
- astro-books.to-email-max.workers.dev
Branch
optimized
cache + fonts
Latest benchmark
Mobile Lighthouse lab results from PageSpeed Insights on : the median of 3 runs per host, averaged across the hosts listed. The benchmark page explains each metric and has every other framework.
| Build | Path | Perf | FCP | Raw FCP | LCP | TBT | CLS | SI | TTI | Doc | Hosts |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Book list / | |||||||||||
| baseline | / | 85 | (good)1.53 | 1.35 | (poor)4.36 | (good)0 | (good)0.000 | 2.52 | 4.36 | 196 | 3/3 Vercel, Netlify, Cloudflare |
| optimized | / | 98 | (good)0.94 | 0.21 | (good)2.06 | (good)0 | (good)0.001 | 1.09 | 2.06 | 78 | 3/3 Vercel, Netlify, Cloudflare |
| Book page /10145787 | |||||||||||
| baseline | /10145787 | 96 | (good)1.52 | 0.95 | (needs improvement)2.57 | (good)0 | (good)0.000 | 2.15 | 2.57 | 137 | 3/3 Vercel, Netlify, Cloudflare |
| optimized | /10145787 | 100 | (good)0.93 | 0.21 | (good)1.25 | (good)0 | (good)0.000 | 0.93 | 1.25 | 83 | 3/3 Vercel, Netlify, Cloudflare |
- Good
- Needs improvement
- Poor
FCP 1.8 s / 3 s · LCP 2.5 s / 4 s · TBT 200 ms / 600 ms · CLS 0.1 / 0.25
Per host
The medians above before averaging. Runs is how many measured runs went into each median. Host names link to the deployment.
| Build | Path | Host | Perf | FCP | Raw FCP | LCP | TBT | CLS | SI | TTI | Doc | Runs | Status |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Astro | |||||||||||||
| baseline | / | Vercel | 84 | (good)1.54 | 1.29 | (poor)4.36 | (good)0 | (good)0.000 | 2.44 | 4.36 | 116 | 3/3 | OK |
| baseline | / | Netlify | 85 | (good)1.51 | 1.34 | (poor)4.36 | (good)0 | (good)0.001 | 2.49 | 4.36 | 187 | 3/3 | OK |
| baseline | / | Cloudflare | 85 | (good)1.54 | 1.44 | (poor)4.36 | (good)0 | (good)0.000 | 2.64 | 4.36 | 284 | 3/3 | OK |
| baseline | /10145787 | Vercel | 96 | (good)1.51 | 1.33 | (needs improvement)2.56 | (good)0 | (good)0.000 | 2.47 | 2.56 | 133 | 3/3 | OK |
| baseline | /10145787 | Netlify | 96 | (good)1.54 | 1.33 | (needs improvement)2.59 | (good)0 | (good)0.001 | 2.48 | 2.59 | 174 | 3/3 | OK |
| baseline | /10145787 | Cloudflare | 97 | (good)1.51 | 0.18 | (needs improvement)2.56 | (good)0 | (good)0.000 | 1.51 | 2.56 | 105 | 3/3 | OK |
| optimized | / | Vercel | 100 | (good)0.93 | 0.16 | (good)1.35 | (good)0 | (good)0.000 | 0.93 | 1.35 | 46 | 3/3 | OK |
| optimized | / | Netlify | 100 | (good)0.94 | 0.25 | (good)1.66 | (good)0 | (good)0.003 | 1.16 | 1.66 | 106 | 3/3 | OK |
| optimized | / | Cloudflare | 93 | (good)0.94 | 0.22 | (needs improvement)3.15 | (good)0 | (good)0.000 | 1.18 | 3.15 | 81 | 3/3 | OK |
| optimized | /10145787 | Vercel | 100 | (good)0.92 | 0.20 | (good)1.20 | (good)0 | (good)0.000 | 0.92 | 1.20 | 82 | 3/3 | OK |
| optimized | /10145787 | Netlify | 100 | (good)0.93 | 0.23 | (good)1.21 | (good)0 | (good)0.000 | 0.93 | 1.21 | 124 | 3/3 | OK |
| optimized | /10145787 | Cloudflare | 100 | (good)0.93 | 0.19 | (good)1.35 | (good)0 | (good)0.000 | 0.93 | 1.35 | 42 | 3/3 | OK |