Skip to content
← Back to Changelog

Tuesday, March 16th 2021

Faster builds with per-branch caching

Posted by

Avatar for styfle

Steven Salat

Software Engineer

Avatar for lucleray

Luc Leray

Engineering Manager

The Build Step now considers the current Git branch when reading and writing the cache.

Since the first push to a branch will create a deployment without a branch-specific cache, it will read from the Production branch's cache. Subsequent pushes to that branch will read from its own branch-specific cache.

This means that Preview branches will no longer write to the Production branch's cache. This leads to faster builds because changing dependencies in one branch won't change the cache of another branch.

In addition, we no longer delete the build cache when a build fails. Instead, you can manually trigger a build without cache by using the "Redeploy" button on the Dashboard.

Our tests with a large Next.js app brought down incremental build times from 13 minutes to 4 minutes.

Check out the documentation as well.