Build caching comes to Cloudflare Pages

Cloudflare Pages is rolling out a beta of build caching, a feature designed to shorten build times by storing and reusing artifacts from previous builds. The goal is to let developers skip expensive, repetitive parts of the CI/CD pipeline and get their changes live sooner.

Long build times are a known friction point in development workflows. Every forced wait breaks concentration, and across a team, those delays compound as iteration cycles stretch and deployments back up. Build caching targets that problem directly, which is why the Pages team has been working on it alongside broader infrastructure improvements.

What the cache stores

The feature works at two levels: dependencies and build output.

  • Dependencies. When a build starts, the Pages CI system checks for cached artifacts. If prior dependency installation results are found, they are restored instead of re-fetched, which shortens the installation step.
  • Build output. For supported frameworks, a cache hit means Pages only recompiles the assets that changed. This enables incremental builds, which can make a significant difference for larger projects.
BLOG-2039 Embedded Image - JpjJDo

The mechanics are straightforward: previously, every build ran from scratch even when most of the codebase was unchanged. Now Pages detects whether cached artifacts can be leveraged, restores them, and recalculates only the modified sections. It’s a move from rebuilding everything to rebuilding only what's necessary.

Supported tools and how to enable it

Dependency caching is available for the node-based package managers npm, yarn, pnpm, and the popular framework Astro in this release. The documentation lists what is currently supported and what is planned.

  • Node-based package managers: npm, yarn, pnpm, and Bun
  • Frameworks with native incremental build support: Gatsby.js, Next.js, and Astro

Enabling the feature doesn't require any changes to your existing project setup. For projects already on Pages, go to the project settings and toggle the Build Cache option. From there, once a new commit triggers a Pages CI build, caching kick in automatically and handles the rest in the background.

BLOG-2039 Embedded Image - tOayMP

Feedback and next steps

The beta is live today, and the Pages team is welcoming testers to share their experience. Be sure to check the caching limitations and upcoming features in the official documentation, and don't hesitate to visit the pages on Discord. As with any beta, feedback is the driving force behind what lands in a future stable release.