Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 1.72 KB

experimental-static-build.mdx

File metadata and controls

33 lines (23 loc) · 1.72 KB
title description publishDate authors lang
Scaling Astro to 10,000+ Pages
A new experimental flag in Astro build enables building sites with tens of thousands of pages.
January 25, 2022
matthew
en

import Note from '../../components/Note.astro';

This blog post introduces a feature that was new to Astro in early 2022, prior to our official 1.0.0 release.

The --experimental-static-build flag is no longer required. It became the default build strategy in Astro 1.0.0.

Astro is about to get a lot faster! Our new build optimization process is ready to try out in Astro today:

astro build --experimental-static-build

Our new build system can scale to tens, or even hundreds, of thousands of pages. If you hang out in our Discord or pay attention to recent releases you might have seen a lot of discussion about a "static build". Our new implementation of astro build does 2 things:

  • Improves build times by up to 75%.
  • Lowers memory usage when building very large sites (10,000+ pages).

This new build works by first building an SSR version of your app and then rendering each page to HTML. Because the site is pre-optimized it can render each page in parallel and will never run out of memory.

If you are a current Astro user please try out this new build by passing the flag in your build script.

This build approach will remain flagged for the next few releases until we iron out any issues, at which point we plan to promote it to be the default astro build command. Please help us by reporting issues you encounter, either in the Discord or by filing an issue.