Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk4 min

Turbopack’s Persistent Build Cache Only Helps If Your CI Keeps It

A Turbopack filesystem cache cannot warm a later CI build unless the workflow restores its data first and saves it afterward. Next.js 16 cache defaults and documented paths require version-specific checks.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Yes—but only when CI restores Turbopack’s cache before a build and saves it afterward. If each job starts on a fresh worker with no restored cache, that build is cold, regardless of whether filesystem caching is enabled. For Next.js 16, check your exact version and cache paths: Turbopack’s documentation describes filesystem-cache data under .next, while the general CI guide tells users to persist .next/cache.

What makes a Turbopack cache persist in CI?

A persistent build cache is useful across CI runs only if cache data survives the end of one run and is available before the next run starts building. A typical workflow therefore needs both a restore step before next build and a save step afterward. If a job runs on a new, empty worker and does not restore prior cache data, it cannot benefit from a previous job’s cache.

As an Amazon Associate I earn from qualifying purchases.

Next.js’s Turbopack filesystem-cache documentation says that, when enabled, Turbopack saves and restores data in the .next folder. The separate Next.js CI build-caching guide recommends persisting .next/cache between builds and notes that Vercel caching is automatic. Those descriptions are not enough to assume that .next/cache covers every Turbopack cache location in every Next.js version or workflow.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Verify the paths in your own workflow

  • Check the cache location documented for the exact Next.js version installed in CI.
  • Inspect which paths your workflow actually restores before the build and saves after it.
  • Make sure the path Turbopack uses is included in both operations; do not assume that naming a parent or sibling directory covers it.
  • Follow your CI provider’s current syntax and rules for cache keys, retention, and sharing. The Next.js guidance does not establish universal rules for those provider-specific choices.

Which Next.js 16 setting controls filesystem caching?

In Next.js 16, Turbopack is the default bundler for both next dev and next build; use --webpack to opt out. That does not mean development and production-build filesystem caching have identical defaults. The filesystem-cache documentation lists development caching as stable and enabled by default starting in v16.1.0. Production-build caching remains experimental and opt-in through experimental.turbopackFileSystemCacheForBuild. Check the installed version and its documentation before changing a production workflow.

import type { NextConfig } from 'next'

const nextConfig: NextConfig = {
  experimental: {
    turbopackFileSystemCacheForDev: true,
    turbopackFileSystemCacheForBuild: true,
  },
}

export default nextConfig

This example shows the documented configuration flags, not a recommendation to enable both indiscriminately. In current v16 documentation, the development flag is already on by default, while enabling filesystem caching for production builds uses an experimental option. Confirm that the option is supported in your installed version and decide whether its experimental status is acceptable for your build.

How to tell whether CI is getting a warm build

Compare cold and warm builds under controlled conditions instead of relying on the presence of a cache configuration alone. The Turbopack API reference recommends deleting .next for cold-build comparisons or enabling filesystem caching to compare warm builds.

  1. Record the environment. Keep the commit, dependency state, runner class, and build command the same for each comparison.
  2. Run a cold build. Remove .next before building, as appropriate for your workflow, and record the build time.
  3. Run a warm build. Enable the supported filesystem-cache setting for your version, restore the relevant cache before the build, then build with the same inputs and command.
  4. Measure the whole CI cost. Include cache restore and save time, not just the duration of next build. Repeat runs if needed to distinguish a consistent result from one-off variation.

No universal CI speedup is established for Turbopack filesystem caching. Results depend on the project and workflow, and should be reported only with the conditions under which they were measured.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When can caching make CI slower?

Cache storage and transfer are not free. Next.js’s engineering article, “Inside Turbopack: Building Faster by Building Less”, warns that incremental caching adds CPU and memory overhead and can hurt performance when applied poorly. A cache that takes longer to restore and save than the work it avoids may increase total CI time.

Keep the decision tied to your own measurements: compare total time with and without caching, including restore and save. The official guidance does not establish a universal winning provider, cache-key strategy, retention period, or cross-branch sharing policy; those details depend on your CI service and workflow.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What to check when a supposedly warm build stays cold

  • No prior state is available: the job may be running on an ephemeral worker without a successful restore.
  • The wrong directory is persisted: check the installed version’s documented cache location and compare it with the paths in the restore and save steps.
  • The restore happens too late: cache data must be available before the build starts.
  • The feature is not enabled for that workload: verify the version-specific default or configuration, especially for experimental production-build caching.
  • The cache costs more than it saves: measure end-to-end CI time, including cache operations, before keeping the configuration.

For Next.js 16’s default bundler behavior and Webpack opt-out, see the version 16 upgrade guide.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.