TTS Cache Options
Updated: Apr 15, 2026
Two options can be used for TTS caching with the Voice SDK TTS package:
The TtsMemoryCache holds loaded TTS clips and returns them immediately if a load request is made for the same clip. The memory cache will keep all files in memory indefinitely unless an LRU (Least Recently Used) clip limit or RAM limit is placed on it. When a limit has been passed, the TtsMemoryCache will automatically unload the least recently used TTS clips. The TtsMemoryCache uses the following parameters:
- Is Clip Capacity Enabled: Whether a clip total should be limited. Enabled by default.
- Clip Capacity: The maximum number of clips allowed when limited. Defaults to 100.
- Is Memory Capacity Enabled: Whether the runtime cache should limit clips loaded based on RAM. Disabled by default.
- Memory Capacity in Kilobytes: Capacity of the runtime cache when limited (in KB). Defaults to 1024 KB.
The TtsStorageCache is used for handling storage and streaming of files from disk. This cache allows for downloading TTS files to disk so that they will load quicker on subsequent use. While the TtsStorageCache contains default settings to be used with TTS requests, these can be overridden on a per-request basis. The TtsStorageCache has the following parameters:
- Cache Directory: The path for the disk cache relative to the disk cache location. Defaults to
WitTTS/Cache. - Default Cache Location: The default disk cache location for TTS clips. This setting can be overridden on a per-request basis. Defaults to None. Available options for the disk cache location:
- Default: Uses the default cache location specified in the storage cache component.
- None: No disk caching is used.
- Content: Files will be loaded from the Content directory. When running in the editor, this setting will also save clips to the Content folder so they can be loaded or used later.
- Persistent: Uses the application’s on-device persistent directory, which will remain on disk until deleted. This should only be used for a very limited number of clips.
- Temporary: Uses the application’s on-device temporary directory, which will remain on disk until the device decides it should be deleted.