---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../modules.md) / [docs](../index.md) / initializeContentCache

# Function: initializeContentCache()

> **initializeContentCache**(`cacheDir`): `void`

Defined in: [packages/b2c-tooling-sdk/src/docs/content-cache.ts:54](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/67fb8580ac3c5b372617ee3ec3fc8f2bc9f16174/packages/b2c-tooling-sdk/src/docs/content-cache.ts#L54)

Points the on-disk content cache at oclif's `cacheDir`.

The CLI and MCP call this from `BaseCommand.init()` with `this.config.cacheDir`
so cached docs live alongside other oclif cache data (e.g. `~/.cache/b2c` on
Linux, `~/Library/Caches/b2c` on macOS) and honor any oclif dir overrides —
mirroring how initializeStatefulStore injects `dataDir`. Standalone SDK
use (no oclif) falls back to an OS-idiomatic path.

## Parameters

### cacheDir

`string`

oclif's resolved `this.config.cacheDir`

## Returns

`void`
