This page is also available as Markdown: request this page's URL with an
Accept: text/markdown header. For an index of Next.js documentation, see /docs/llms.txt.Turbopack FileSystem Caching
Last updated August 3, 2026
Usage
Turbopack FileSystem Cache enables Turbopack to reduce work across next dev or next build commands. When enabled, Turbopack will save and restore data under the .next directory between runs, which can greatly speed up subsequent builds and dev sessions.
Two options control the cache, one for next dev and one for next build. Both are enabled by default:
next.config.ts
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
experimental: {
turbopackFileSystemCacheForDev: true,
turbopackFileSystemCacheForBuild: true,
},
}
export default nextConfigOptions
turbopackFileSystemCacheForDev(default:true): caches Turbopack's work fornext devin.next/dev/cache/turbopack. Restarting the dev server reuses the previous compilation.turbopackFileSystemCacheForBuild(default:true): caches Turbopack's work fornext buildin.next/cache/turbopack. Subsequent builds start warm. See Build environments.
Set either option to false to opt out.
Build environments
The build cache lives in .next/cache. Builds only get faster when that directory is restored before each build.
- Self-hosted builds: reuse the same working directory between builds. Containerized builds start from a clean layer and do not carry
.next/cacheover unless you cache or mount it explicitly. - CI providers: configure build caching for
.next/cache.
If your build environment never preserves .next/cache, set turbopackFileSystemCacheForBuild: false to skip writing a cache that will not be read.
Version History
| Version | Changes |
|---|---|
v16.3.0 | FileSystem caching is enabled by default for builds |
v16.1.0 | FileSystem caching is enabled by default for development |
v16.0.0 | Beta release with separate flags for build and dev |
v15.5.0 | Persistent caching released as experimental on canary releases |
Was this helpful?