Astro 7.0.0-beta.6 Stabilizes Route Caching and Promotes JSX Whitespace Compression to Default

Astro 7.0.0-beta.6 Stabilizes Route Caching and Promotes JSX Whitespace Compression to Default

lschvn

Astro 7.0.0-beta.6 shipped on June 19, 2026, one day after beta.5 on June 18, and continues the 7.0 line's run of graduating every long-running experimental feature to stable. The headline of beta.6 is that route caching, which has been behind experimental.cache and experimental.routeRules since the 6.0 launch, is now a top-level stable API. Beta.5, the release right before it, changed the compressHTML default to 'jsx', which alters the rendered output of any project that relied on whitespace between inline elements being preserved. Both changes land on top of the beta.4 stabilization of the Sätteri Markdown pipeline as the default, covered in the Astro 7.0.0-beta.4 release notes earlier in the cycle.

The 7.0 line is on a fast burn toward stable. Beta.4 (June 15), beta.5 (June 18), beta.6 (June 19), and two alphas before them have graduated almost every experimental API 6.x shipped behind a flag, settled on Rust-native Markdown, switched the default whitespace handling to JSX-style, and now moved route caching to stable. The migration cost for any project on 6.x is real but mechanical: a config rename, a whitespace audit, and a check that your custom cache provider is one of the supported top-level options.

Route caching is now stable

Route caching was the last major experimental block left from 6.0. Beta.6 promotes it to a top-level config. The migration is one rename plus a provider choice:

// astro.config.mjs
import { defineConfig, memoryCache } from 'astro/config';

export default defineConfig({
  cache: {
    provider: memoryCache(),
  },
  routeRules: {
    '/blog/[...path]': { maxAge: 300, swr: 60 },
  },
});

In .astro pages you set directives with Astro.cache, and in API routes and middleware you use context.cache. Astro translates those directives into the appropriate headers or runtime behavior for the configured provider, so the same config works against memoryCache, fsCache, cloudflareKV, vercelISR, and the other providers that ship with the 7.0 line. The full provider matrix is documented in the route caching guide that ships with the release.

For prerendered pages the rules still apply at build time: the directives are encoded into the static HTML's Cache-Control headers, which means a CDN in front of your site will respect the same maxAge and swr you would have used for an on-demand rendered page. This is the part that is the most subtle change for projects that already had a CDN in front of prerendered output: the same routeRules config now controls both the on-demand runtime cache and the static-asset cache headers.

'jsx' is the new default for compressHTML

Beta.5 made 'jsx' the new default value for the compressHTML option. This is the same whitespace-stripping mode React, Solid, Preact, and the other JSX-based frameworks use: whitespace around elements is removed, and a single line of meaningful whitespace between two inline elements is preserved.

The difference matters in practice. In the legacy HTML-aware compression mode (the old compressHTML: true default), Astro kept a single space between two inline elements when there was a literal newline between them in the source. In the new 'jsx' default, that newline is stripped, which means a template like:

<p>
  Hello <span>world</span>
</p>

renders the same as before, but a template like:

<p>
  Click
  <a href="/x">here</a>
  for more
</p>

now renders without the line break between "Click", the link, and "for more". Anywhere you actually wanted that whitespace to be visible, write it explicitly with {' '}.

For projects that need to keep the old behavior while they audit, the migration is one line:

// astro.config.mjs
export default defineConfig({
  compressHTML: true, // HTML-aware compression, the 6.x default
});

Set compressHTML: false to disable compression entirely, or compressHTML: 'jsx' to keep the new default explicitly. Beta.5 also fixes a handful of astro/hono and astro/fetch advanced routing bugs that have been landing across the 7.0 cycle, including one where the custom 500.astro page received an empty error prop when the error originated in middleware.

The wider 7.0 picture

Between beta.4 and beta.6, the 7.0 line has now stabilized or replaced almost every experimental feature that 6.x shipped behind a flag. Sätteri (Rust-native Markdown) is the default, advanced routing with Hono is stable, the custom logger is stable, the streaming rendering engine is stable, the JSX-style whitespace compression is the default, and route caching is now stable at the top level. The remaining 7.0 work before stable is mostly build tooling polish, the final @astrojs/markdown-satteri graduation, and the Vite 8 support that landed across the alpha and beta cycle.

What to do now

For projects on 6.x: upgrade to the latest 6.x patch and start the config migration early. Move cache and routeRules out of experimental, decide which provider you want, and run beta.6 against a staging branch. Audit your templates for the whitespace change: anywhere you rely on a newline between two inline elements producing visible whitespace, switch to {' '} or fall back to compressHTML: true until you have time to do the audit properly. The full list of breaking changes in the 7.0 line is in the CHANGELOG on the withastro/astro repo. Pin production to the 6.x line and treat beta.6 as the validation target.

Frequently Asked Questions

Related articles

More coverage with overlapping topics and tags.

Astro 7.0.0-beta.4 Makes Sätteri the Default Markdown Processor, Promotes Advanced Routing, Custom Logger, and Queued Rendering to Stable
frameworks

Astro 7.0.0-beta.4 Makes Sätteri the Default Markdown Processor, Promotes Advanced Routing, Custom Logger, and Queued Rendering to Stable

Astro 7.0.0-beta.4 (June 15, 2026) flips the Sätteri Rust-based Markdown pipeline on by default, removes the experimental flag from advanced routing, the custom logger, and the new rendering engine, deletes the deprecated astro db/login/logout/link/init CLI commands, and folds the dev-server background mode added in alpha.2 into the default CLI.
Oxlint v1.71 and Oxfmt v0.56 Ship the v0.137 Crates Wins, Land 18 New Linter Rules, and Tame React Lifecycle Traversal with a Streamed-Iterator Refactor
tooling

Oxlint v1.71 and Oxfmt v0.56 Ship the v0.137 Crates Wins, Land 18 New Linter Rules, and Tame React Lifecycle Traversal with a Streamed-Iterator Refactor

Oxlint apps_v1.71.0 and oxfmt apps_v0.56.0, both published on 2026-06-22, close out the v0.137 crates cycle. Oxlint v1.71 picks up the new treeshaking pure typed arrays minifier pass (#23469), the prefer-query-selector compound selector fix, 28 lint bug fixes (most of them Yunfei He's fixer-rewrite work), 13 performance entries anchored on a bucketed rule dispatch refactor (#23450, #23452, #23482-#23486, #23489, #23492), and the oxlint Tokio-on-LSP-only startup (#23447). Oxfmt v0.56.0 ships 9 bug fixes (CRLF normalization for `// @ts-ignore` suppressed text in #23701 and #23702, the member-chain panic fix #23698, the default-export-with-type-cast preservation #23697) and 3 formatter performance entries that remove arena copies on bigint, numeric-literal, and string-literal text. v1.71 is the first apps release since v1.70.0 on 2026-06-15, and the last one before the v0.138 crates release that will land on Monday 2026-06-29.
Astro 7.0.0 Stable Ships Vite 8, Makes the Rust Compiler Default, Adds a Background Dev Server for AI Coding Agents, and Promotes Route Caching, Advanced Routing, and Sätteri to First-Class
frameworks

Astro 7.0.0 Stable Ships Vite 8, Makes the Rust Compiler Default, Adds a Background Dev Server for AI Coding Agents, and Promotes Route Caching, Advanced Routing, and Sätteri to First-Class

Astro 7.0.0, published on 2026-06-22, lands the 7.0 stable branch after ten weeks of beta. The headline changes: a Vite 8 upgrade, the Rust-based Astro compiler as the default (the Go compiler is removed), the Sätteri Markdown pipeline as the default (remark/rehype moves out of the default install), advanced routing promoted from experimental (with src/fetch.ts as the new default entrypoint), route caching promoted from experimental (top-level cache and routeRules, with cacheNetlify() and cacheVercel() providers landing in the same release), a background dev server mode designed for AI coding agents (astro dev --background, .astro/dev.json lockfile, astro dev stop|status|logs), compressHTML: 'jsx' as the new default, the @astrojs/db package removed, and every official integration bumped a major version (vue 7, react 6, svelte 9, preact 6, solid-js 7, vercel 11, netlify 8, node 11). create-astro@5.1.0, shipped in the same release wave, now writes an AGENTS.md file into every new project with a CLAUDE.md symlink pointing at it.

Comments

Log in Log in to join the conversation.

No comments yet. Be the first to share your thoughts.