> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# performance.buildCache

- **Type:**

```ts
type BuildCacheConfig =
  | {
      /**
       * Base directory for the filesystem cache.
       */
      cacheDirectory?: string;
      /**
       * Set different cache names based on cacheDigest content.
       */
      cacheDigest?: Array<string | undefined>;
      /**
       * An arrays of additional code dependencies for the build.
       * Rspack will use a hash of each of these items and all dependencies to invalidate the filesystem cache.
       */
      buildDependencies?: string[];
    }
  | boolean;
```

Controls the caching behavior during the build process.

Modern.js will enable build cache by default to improve the compile speed. You can disable the build cache by setting it to `false`:

```js
export default {
  performance: {
    buildCache: false,
  },
};
```

:::info
The usage of this configuration item is exactly the same as that of Rsbuild. For detailed information, please refer to [Rsbuild - performance.buildCache](https://v2.rsbuild.dev/config/performance/build-cache).
:::