> For the complete documentation index, see [llms.txt](https://enoch-app.gitbook.io/enoch/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://enoch-app.gitbook.io/enoch/api-references/unreal-engine-sdk/memorycache.md).

# MemoryCache

Memory cache for preloading and reusing the avatars.EnochAvatar**MemoryCache** is used to preload avatars and store the cached skeletal meshes. Cached avatars will be instantiated instantly. It's mainly used for preloading the avatars in the background.

### Properties <a href="#properties" id="properties"></a>

| Property      | Type                            | Description                                                       |
| ------------- | ------------------------------- | ----------------------------------------------------------------- |
| CachedAvatars | TArray\<FAvatarMemoryCacheData> | The avatar URL or shortcode used to load the avatar from the web. |

### Public Functions <a href="#public-functions" id="public-functions"></a>

| Function                                                                                                                                | Returns                | Text                                                                                                                     |
| --------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `Preload(const TArray& PreloadDataList, const FAvatarPreloadCompleted& OnPreloadCompleted)`                                             | void                   | Preloads the avatar data so the avatars would be instantiated instantly when loading them from the EnochavatarComponent. |
| `GetAvatarCacheData(const FString& Url, U`Enochavatar`AvatarConfig* AvatarConfig) const`                                                | FAvatarMemoryCacheData | Returns the preload avatar data for a specific avatar.                                                                   |
| `AddAvatar(const FString& Url, U`Enochavatar`AvatarConfig* AvatarConfig, USkeletalMesh* SkeletalMesh, const FAvatarMetadata& Metadata)` | void                   | Adds an already loaded avatar to the memory cache.                                                                       |
| `RemoveAvatar(const FString& Url)`                                                                                                      | void                   | Removes specific avatar data from the memory cache.                                                                      |
| `RemoveAvatar()`                                                                                                                        | void                   | Clears all avatars from the memory cache.                                                                                |

​
