Performance: Incremental builds with data
This affects page load speed by reducing build time and improving how quickly updated content appears on the site.
astro build --incremental
// Only rebuilds pages with changed dataastro build --no-incremental // Rebuilds entire site every time data changes
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Full rebuild on data change | N/A (build time only) | N/A | Delays initial paint | [X] Bad |
| Incremental build with data tracking | N/A (build time only) | N/A | Faster initial paint due to quicker build | [OK] Good |
getStaticPaths to define dynamic routes for static generation.getStaticPaths tells Astro which pages to build incrementally with data.export async function getStaticPaths() {
return [
{ params: { id: '1' } },
{ params: { id: '2' } }
];
}export async function getStaticPaths() {
return {
params: [
{ id: 'a' },
{ id: 'b' }
]
};
}Pass the test and this pattern moves unknown