> For the complete documentation index, see [llms.txt](https://potassium.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://potassium.gitbook.io/api/environment/cache.md).

# Cache

## cache.invalidate

```lua
<nil> cache.invalidate(<Instance> object)
```

Deletes `object` from the Instance cache. Effectively invalidates `object` as a reference to the underlying Instance.

***

## cache.iscached

```lua
<boolean> cache.iscached(<Instance> object)
```

Checks whether `object` exists in the Instance cache.

***

## cache.replace

```lua
<nil> cache.replace(<Instance> object, <Instance> newobject)
```

Replaces `object` in the Instance cache with `newObject`.

***

## cloneref

```lua
<Instance> cloneref(<Instance> object)
```

Returns a copy of the Instance reference to `object`. This is useful for managing an Instance without directly referencing it.

***

## compareinstances

```lua
<boolean> compareinstances(<Instance> a, <Instance> b)
```

Returns whether objects `a` and `b` both reference the same Instance.

***
