Astro 7.2 ships four notable changes. The headline feature is experimental incremental static builds: routes can now return a `cacheKey` from `getStaticPaths()`, and Astro skips re-rendering pages whose module graph hash and cache key both match the previous build, storing the cache in `node_modules/.astro/`. A new `session: false` option lets SSR projects opt out of session support entirely, removing the session runtime from the bundle; projects without a configured driver also benefit automatically via tree-shaking. The `astro preview` command gains the same background mode introduced for `astro dev` in Astro 7, allowing the preview server to run detached with log file output and follow-up management commands. Finally, `logger.entrypoint` now accepts a plain relative string in addition to the previously required URL object.
Table of contents
Experimental: incremental static buildsOpt out of session supportBackground mode for astro previewRelative logger entrypointsOther improvementsCommunityQuestions this post answers
How does incremental static builds work in Astro 7.2 and how do I enable it?
Incremental static builds in Astro 7.2 are enabled with the `experimental.incrementalBuild` flag. Each route opts in by returning a `cacheKey` per path from `getStaticPaths()` — for content collections, `entry.digest` is recommended. Astro also hashes the full module graph (template, layouts, components, assets, packages); a page is only reused when both the module hash and `cacheKey` match the previous build. The cache lives in `node_modules/.astro/` by default. Teams running large Astro docs or marketing sites track build performance changes like this on daily.dev.
How do I disable session support in Astro to reduce bundle size?
Set `session: false` in your Astro config. This prevents Cloudflare, Netlify, and Node adapters from wiring up their default session driver and removes the session runtime from the SSR bundle. `Astro.session` becomes `undefined`, a state its type already allowed, so existing `if (Astro.session)` guards continue to work. Projects with no driver configured also benefit automatically through tree-shaking without setting the flag. Developers optimizing Astro SSR cold-start times find relevant bundle-size discussions on daily.dev.
14.5K Impressions1 Comment