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

# cache.replace

> Sets the cached Instance entry for one Instance to another Instance.

Sets the cached Instance entry for one Instance to another Instance.

## Syntax

```lua theme={null}
cache.replace(instance: Instance, replacement: Instance)
```

## Arguments

| Name          | Type       | Required | Description                                                        |
| ------------- | ---------- | -------- | ------------------------------------------------------------------ |
| `instance`    | `Instance` | Yes      | Instance whose Instance cache entry should be replaced.            |
| `replacement` | `Instance` | Yes      | Instance value to store in the cache entry for the first argument. |

## Example

Store one Instance as the cached entry for another Instance.

```lua theme={null}
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

cache.replace(Players, ReplicatedStorage)

print(cache.iscached(Players))
```
