Astro experimental flags are opt-in settings under the experimental key in astro.config.mjs that give early access to features before they are stable. You turn one on with experimental: { flagName: true } (or a config object for some flags), and the feature may change or be removed in any minor release. Astro 7 includes flags for incremental builds, chunked content storage, SVG optimisation, client-side prerendering, content IntelliSense and Chrome DevTools workspaces, with more added in 7.4.
Experimental does not mean broken. Many flags are close to stable and are used in production by teams willing to track release notes. The trade-off is that you accept breaking changes without a major version bump.
Key Takeaways
- Experimental features live under
experimentalinastro.config.mjsand are off by default.- Their API can change in any minor release. Pin your Astro version and read release notes before upgrading.
- Astro 7.2.9 includes six flags:
incrementalBuild,collectionStorage,svgOptimizer,clientPrerender,contentIntellisenseandchromeDevtoolsWorkspace.- Astro 7.4 added experimental parallel prerendering and experimental custom redirect pages; check the 7.4 release notes for their flag names.
- When a flag becomes stable, Astro removes it and the option moves to the main config; release notes say what to change.
How experimental flags work
Astro adds new features behind flags when the team wants real-world feedback before committing to an API. A flag can then:
- Change shape based on feedback.
- Become stable, usually in a minor release, after which the flag is removed and the feature is either always on or configured outside
experimental. - Be dropped if the approach does not work.
Examples of this path include the Fonts API, content security policy and responsive images, all of which started as flags and are now standard configuration. The Astro config cheatsheet covers the stable options.
Enabling a flag
All flags go in one object:
// astro.config.mjs
import { defineConfig } from 'astro/config';
export default defineConfig({
experimental: {
incrementalBuild: true,
collectionStorage: 'chunked',
},
});
Restart the dev server after changing flags. TypeScript will flag unknown or removed options if your config is typed, which is the quickest way to notice a flag that has been renamed or stabilised.
The flags in Astro 7
incrementalBuild
Skips re-rendering static pages that have not changed since the last build. Pages opt in by returning a cacheKey from getStaticPaths(). On later builds, Astro compares each page’s cacheKey and the hash of its module dependency graph to a saved manifest; if both match, it keeps the previous output.
// astro.config.mjs
import { defineConfig } from 'astro/config';
export default defineConfig({ experimental: { incrementalBuild: true } });
---
// src/pages/blog/[slug].astro
export async function getStaticPaths() {
const posts = await fetch('https://cms.example.com/posts').then((r) => r.json());
return posts.map((post) => ({
params: { slug: post.slug },
props: { post },
cacheKey: post.updatedAt, // changes only when the post changes
}));
}
const { post } = Astro.props;
---
<h1>{post.title}</h1>
This matters for large sites where most pages are unchanged between deploys. Your CI must preserve the build cache between runs for it to help; the CI build cache tip shows how. Added in Astro 7.2.
collectionStorage
Controls how the content layer’s data store is written. By default everything goes into one data-store.json. On very large collections, that file can exceed platform file-size limits. Setting 'chunked' splits it into files up to 20 MiB, or you can set your own size:
// astro.config.mjs
import { defineConfig } from 'astro/config';
export default defineConfig({
experimental: {
collectionStorage: { type: 'chunked', chunkSize: 1024 * 1024 },
},
});
The Astro docs recommend a 1 MiB chunk size for broad adapter compatibility. Added in Astro 7.1. Most sites never need it.
svgOptimizer
Optimises imported SVG files at build time. Pass an optimiser, such as the SVGO-based one exported from astro/config:
// astro.config.mjs
import { defineConfig, svgoOptimizer } from 'astro/config';
export default defineConfig({
experimental: { svgOptimizer: svgoOptimizer() },
});
It affects SVGs you import as components or assets, not files in public/. Check icons visually after enabling it, since aggressive optimisation can remove IDs or attributes that your CSS or scripts rely on. Added in Astro 6.2.
clientPrerender
Upgrades Astro’s prefetching to use the browser’s Speculation Rules API, so supported browsers prerender the next page in the background, not just fetch it:
// astro.config.mjs
import { defineConfig } from 'astro/config';
export default defineConfig({
prefetch: { prefetchAll: true, defaultStrategy: 'viewport' },
experimental: { clientPrerender: true },
});
Navigation to a prerendered page can feel instant. The risks: prerendering runs page scripts and analytics before the visitor clicks, and wastes bandwidth if they never do. Browsers without support fall back to normal prefetching. Read the prefetch tip before turning on prefetchAll.
contentIntellisense
Generates JSON schemas from your content collection schemas so the Astro language server can offer autocomplete and hints inside Markdown and MDX frontmatter. You also need to enable astro.content-intellisense in the VS Code extension settings.
// astro.config.mjs
import { defineConfig } from 'astro/config';
export default defineConfig({ experimental: { contentIntellisense: true } });
It has no effect on build output, so it is one of the safest flags to try.
chromeDevtoolsWorkspace
Configures a Chrome DevTools workspace for the dev server, so edits made in DevTools can be saved back to your source files. It only affects astro dev. Useful for designers who tweak CSS in the browser.
New in Astro 7.4
Astro 7.4, released on October 15, 2026, added two more experimental features:
- Parallel prerendering, which renders static pages concurrently to shorten builds of large sites.
- Custom redirect pages, which let you control the HTML Astro generates for redirects on static output.
The same release added astro build --timings (a stable CLI flag that reports where build time goes) and notFound() for custom entrypoints. Check the Astro 7.4 release post for exact flag names and options before enabling them, because experimental APIs are most likely to change in the releases right after they appear.
Flag summary
| Flag | Since | Affects | Safe to try |
|---|---|---|---|
incrementalBuild |
7.2 | Static build speed | Yes, with CI cache |
collectionStorage |
7.1 | Data store files | Only if you hit size limits |
svgOptimizer |
6.2 | Imported SVG output | Yes, check icons |
clientPrerender |
4.2 | Client navigation | With care for analytics |
contentIntellisense |
5.x | Editor only | Yes |
chromeDevtoolsWorkspace |
5.13 | Dev server only | Yes |
How to try a flag safely
- Pin Astro. Use an exact version in
package.jsonso an upgrade does not change flag behaviour unexpectedly. - Branch. Enable the flag on a branch and deploy a preview.
- Compare output. For build flags, diff
dist/before and after, or compare page counts and sizes. For runtime flags, test navigation, forms and analytics. - Read the flag’s docs page. Each has a reference page at
docs.astro.build/en/reference/experimental-flags/with known limitations. - Watch release notes. Before every Astro upgrade, check whether your flags changed. The Astro upgrade guide explains the process.
Run astro info to print your Astro version and config details when reporting a problem with a flag. The CLI commands cheatsheet lists it with other commands.
When a flag becomes stable
When Astro stabilises a feature, release notes describe the migration. Typically:
- The
experimental.flagNameoption is removed. - If the feature has settings, they move to a top-level or nested config key (as the Fonts API did with
fonts). - If it is simply on, you delete the flag.
A typed config (defineConfig with TypeScript checking) flags options that no longer exist, so leftovers are easy to spot. The legacy configuration fix covers a related error after upgrades.
Should you use experimental flags in production?
Use them when the benefit is clear and you can absorb a change on upgrade: an agency running dozens of client builds might gain a lot from incrementalBuild. Avoid them on sites you hand off to clients who will upgrade without reading release notes. Every Komal Astro theme ships with stable configuration only, so you choose which flags, if any, to add.
FAQ
How do I enable an experimental feature in Astro?
Add it under experimental in astro.config.mjs, for example experimental: { incrementalBuild: true }, and restart the dev server.
Are Astro experimental flags safe for production?
They work, but their API can change in any minor release. Pin your Astro version, test on a preview deploy, and read release notes before upgrading.
What experimental flags are in Astro 7?
Astro 7.2.9 includes incrementalBuild, collectionStorage, svgOptimizer, clientPrerender, contentIntellisense and chromeDevtoolsWorkspace. Astro 7.4 added experimental parallel prerendering and custom redirect pages.
What happens to my config when a flag becomes stable?
The flag is removed. You delete it, or move its settings to the new stable option described in the release notes.
Where is the list of Astro experimental flags?
The official reference at docs.astro.build lists every current flag with its own page.