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.72 and Oxfmt v0.57 Land the v0.138 Crates Cycle, Unify the AstBuilder, and Retire the Prettier CSS/GraphQL Fallback
tooling

Oxlint v1.72 and Oxfmt v0.57 Land the v0.138 Crates Cycle, Unify the AstBuilder, and Retire the Prettier CSS/GraphQL Fallback

Oxlint apps_v1.72.0 and oxfmt apps_v0.57.0, both published on 2026-06-29, close out the v0.138 crates cycle predicted in the [v1.71 release notes](/articles/2026-06-23--oxlint-v1-71-oxfmt-v0-56). The crates release (crates_v0.138.0, also 2026-06-29) unifies the old and new AstBuilder APIs (#23876, #23834, #23831, with legacy methods marked `#[deprecated]`), renames `AllocatorAccessor` to `GetAllocator` and switches its `allocator` method to take `&self` (#23675, #23676), makes `Str` and `Ident` methods take `&GetAllocator` (#23781), adds `transformer_plugins: Support typeof define keys` for vue-i18n and similar macros (#23605, Alexander Lichter), and ships the headline perf entry of the cycle: `minifier: memoize value_type to remove its O(n^2) re-walk on long binary chains` (#23929, Dunqing), which turns a 20k-term arithmetic-addition chain from 6,118 ms to 4.7 ms (~1300x) and a real-world antd.js bundle from 78.1 ms to 65.4 ms. Oxlint v1.72.0 ships 3 features (React `no-unknown-property` suggestion #23936, AstBuilder unification #23875, `eslint/no-restricted-import` schema #23642), 18 bug fixes, and 23 performance entries. Oxfmt v0.57.0 carries two BREAKING changes that retire the Prettier fallback for CSS/LESS/SCSS and GraphQL files: `Format parser:css,less,scss files + css-in-js by oxc_formatter_css` (#23321, leaysgur) and `Support draft syntax with removing prettier fallback` (#23326, leaysgur), both landing on top of the new `oxc_formatter_css` (#23320) and `oxc_formatter_graphql` (#23317) crates.
Vite 8.1.0 Stable Adds Bundled Dev Mode (15x Startup on 10k React Components), Ships WASM ESM Imports and Chunk Import Map, Extends server.fs.deny With .npmrc and Private Keys
tooling

Vite 8.1.0 Stable Adds Bundled Dev Mode (15x Startup on 10k React Components), Ships WASM ESM Imports and Chunk Import Map, Extends server.fs.deny With .npmrc and Private Keys

Vite 8.1.0 stable, published 2026-06-23 by the Vite Team (announcing-vite8-1), graduates Bundled Dev Mode from an experimental flag into a documented --experimental-bundle entry point (15x faster cold start on a 10k React-component app, 10x faster full reloads, 3x faster cold-start rendering and 40% faster full reloads reported by Linear), stabilises the WASM ESM Integration direct .wasm imports and build.chunkImportMap that shipped in 8.1-beta on 2026-06-15, brings Lightning CSS one step closer to default by adding external-CSS-in-CSS and plugin file dependencies, bumps Rolldown to 1.1.2 (1.1.3 follows the same day), pins rolldown with a tilde range so patch releases flow through without a Vite PR, extends server.fs.deny with .npmrc, .yarnrc.yml, and *.{key,p12,pfx,cer,der}, and emits a runtime warning when envFile: false is used (the deprecation is already documented in the types).

Comments

Log in Log in to join the conversation.

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