-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incremental Build RFC #763
base: main
Are you sure you want to change the base?
Conversation
One small datapoint in favor of the currently experimental content cache: Audiobookaneers.com build: 21:10:55 [build] 5904 page(s) built in 170.55s 21:13:36 [build] 5904 page(s) built in 118.22s Second build was more than 50 seconds (about 30%) faster. I'm hoping to see similar improvements on the Cloudfront side now that they have a "beta" build cache as well, but so far the gains are a bit more minimal (from 2m24s to 1m54s, though this DID include changes to 3 posts content, though not new posts/tags/etc) and their beta build cache only seems to be holding onto In the "best case scenario" when I add a post to /src/content/posts, the following pages would need to be rebuilt:
I tell you what, this has discouraged me from implementing a 'recent posts' sidebar widget into the static build, as that would mean that every single page on the site would need to be regenerated. I'll definitely just use client-side JS for that! And it makes me think about investigating the "hybrid" approach for the pagination as this would cut down a lot of what needs to be rebuilt. |
Build caching idea: //Return a page hash, unique for each page variation
export function getHash() {
//return CMS.pageVersion;
//return CMS.lastUpdateTime;
//return null; //Always rebuild - Sitemap etc
return Astro.props; //Default
}
//OR
export async function getStaticPaths() {
return [
{ hash : /* required for partial building, null by default */ ,params: { /* required */ } ,props: { /* optional */ } },
];
}
---
TEMPLATE If every page had a function (similar to getStaticPaths) called getHash that produced a unique hash for a particular page, then on a new build a list of the previous hashes and new hashes could be compared and only the ones with different hashes would be built. This assumes that the output HTML is deterministic based of its inputs, for example the default implementation of getHash would return: sha256(Astro.props).
|
|
|
||
# Background & Motivation | ||
|
||
The original [incremental build support](https://github.com/withastro/roadmap/discussions/237) proposal is one of our oldest and most highly upvoted issues. The corresponding [roadmap issue](https://github.com/withastro/roadmap/issues/698) has likewise recieved a lot of attention and positive feedback. From the extensive performance profiling we've done, we know that Rollup is the main bottleneck in Astro's build process. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original [incremental build support](https://github.com/withastro/roadmap/discussions/237) proposal is one of our oldest and most highly upvoted issues. The corresponding [roadmap issue](https://github.com/withastro/roadmap/issues/698) has likewise recieved a lot of attention and positive feedback. From the extensive performance profiling we've done, we know that Rollup is the main bottleneck in Astro's build process. | |
The original [incremental build support](https://github.com/withastro/roadmap/discussions/237) proposal is one of our oldest and most highly upvoted issues. The corresponding [roadmap issue](https://github.com/withastro/roadmap/issues/698) has likewise received a lot of attention and positive feedback. From the extensive performance profiling we've done, we know that Rollup is the main bottleneck in Astro's build process. |
# Goals | ||
|
||
- Improve `astro build` performance | ||
- Restructure our |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Restructure our | |
- Restructure our (something?) |
|
||
# Example | ||
|
||
This propsal introduces minimal public API surface changes, but requires many internal implementation details to be updated to support caching in some way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This propsal introduces minimal public API surface changes, but requires many internal implementation details to be updated to support caching in some way. | |
This proposal introduces minimal public API surface changes, but requires many internal implementation details to be updated to support caching in some way. |
Summary
Built-in incremental build support
Links