> ## Documentation Index
> Fetch the complete documentation index at: https://docs.incredibuild.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Build Cache with /Zi (Shared PDB)

Last updated on Dec 02, 2026

Available in Incredibuild for Windows 10.38.0 and later.

This feature is only available in Incredibuild's [Enterprise and Business Plans](https://docs.incredibuild.com/windows/10.38.1/pricing-plans.md).

MSVC projects that compile with `/Zi` write debug information for many `.obj` files into one shared `.pdb` file. The Build Cache client setting `advanced.sharedPdbStrategy` controls how Build Cache handles these compile tasks.

## Default Behavior

No change is required to use Build Cache with `/Zi` projects. The Build Cache client configuration that ships with Incredibuild sets `"sharedPdbStrategy": "forceZ7"`.

In Visual Studio builds and Make and Build Tools builds, while a Build Cache session is active, compile tasks that use `/Zi` (or `/ZI`) are compiled as `/Z7`: debug information is embedded in each `.obj` file instead of a shared `.pdb` file, so the tasks can be cached. In this mode, `/Zi` projects are not cached as true shared-PDB builds.

## Enable Native /Zi Caching

Set `sharedPdbStrategy` to `"cache"` to keep `/Zi` as `/Zi`. Build Cache then caches and restores the shared PDB contents.

On each Initiator, edit the following file:

```text theme={null}
C:\ProgramData\Incredibuild\BuildCache\buildcache_client_config.json
```

* **If the file does not exist**, create it with the following content:

  ```json theme={null}
  {
    "advanced": {
      "sharedPdbStrategy": "cache"
    }
  }
  ```

* **If the file exists**, add `"sharedPdbStrategy": "cache"` to its `"advanced"` section, or add the whole `"advanced"` section if it is missing. Leave the other settings in place and make sure the file remains valid JSON.

This file is merged on top of the shipped defaults in `<install folder>\resources\buildcache_client_config.json`. Do not edit the shipped file.

The setting applies from the next build. Each build loads the merged configuration when its Build Cache session starts.

### sharedPdbStrategy Values

Values are case-sensitive.

| Value | Behavior |
| - | - |
| `"forceZ7"` | **Default.** `/Zi` is compiled as `/Z7` during Build Cache sessions. |
| `"cache"` | `/Zi` shared-PDB builds are cached natively. |
| `"skip"` | Tasks that use a PDB are not cached. Their hit/miss status is `SKIP-PDB-STRATEGY`. |

> [!WARNING]
>
> An unknown or misspelled value is not reported as an error. Build Cache falls back to `"forceZ7"`. If `/Zi` caching does not seem to take effect, check the spelling and case of the value.

### Optional Diagnostics

To list every cache miss in the Build Cache report, add `"listCacheFileStatus": "on"` to the same `"advanced"` section. This setting is not required for `/Zi` caching and may slow down builds. Use it only while verifying your setup, and then remove it (the default is `"auto"`).

## Deployment Types

Native `/Zi` caching works with local cache, shared (remote) Build Cache endpoints, and Build Cache clusters. It uses the same endpoints as other cached tasks.

## Verify That /Zi Tasks Are Cached

1. Run the same build twice.
2. On the second build, check the Build Cache hit/miss report. Tasks restored from cache show `HIT-RESTORED`.

`SKIP-NOT-COVERED-PDB` means that a cache hit could not be used because its PDB data was not restored for that build.

For details, see the Build Cache client log and `ClientStats_<build ID>.json` in the `<install folder>\Logs\BuildCache` folder.

## Limitations

* CMake-generated `/Zi` projects are not yet supported with `"cache"`.
* `/ZI` (Edit and Continue) is not supported with `"cache"`.

Incredibuild does not detect these cases or show a warning for them, so do not set `"cache"` for these projects.

## Related Topics

* [Build Cache - Overview](https://docs.incredibuild.com/windows/10.38.1/build-cache-overview.md)
* [Build Cache - Basic Settings and Configuration](https://docs.incredibuild.com/windows/10.38.1/build-cache-config-basic.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.