How to Make Your Gatsby Cloud Preview Builds 5x Faster
Blog post from Gatsby
Gatsby Cloud has introduced Incremental Deploys for Preview, significantly enhancing the speed of Preview build performance by deploying only the routes and pages that have been updated rather than the entire site. This new feature, announced at GatsbyConf 2022, reduces deploy times dramatically, exemplified by a reduction from 30 seconds to about 1 second for large sites like gatsbyjs.com. Additionally, Gatsby Cloud has launched Content Sync and Preview Status Indicator to improve the user experience for content editors, although these features do not directly affect build performance. Best practices for optimizing Preview performance include avoiding filtering for "published" content in queries, which ensures draft content is included in Previews, and querying for data directly from the page template where it will be used to prevent unnecessary data updates that could disrupt incremental builds. Preview is vital for content editors to visualize their content before it goes live, akin to developers’ use of unit or smoke tests.