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

# cache.iscached

Tells you whether an Instance is still in Seliware's internal instance cache.

```luau theme={null}
cache.iscached(instance: Instance): boolean
```

Seliware keeps an internal cache of game Instances; an Instance you reach through the game tree is normally tracked there, so `cache.iscached` returns `true` for it. Once `cache.invalidate` removes an Instance from that cache, `cache.iscached` returns `false` for it.

Most commonly used to confirm a reference was actually detached after an invalidate call.

## Parameters

| Parameter  | Type                                                                           | Description                           |
| ---------- | ------------------------------------------------------------------------------ | ------------------------------------- |
| `instance` | [`Instance`](https://create.roblox.com/docs/reference/engine/classes/Instance) | The Instance to look up in the cache. |

## Returns

`true` if `instance` is tracked in the instance cache, `false` if it is not.

## Example

In a Roblox game, confirm that a RemoteEvent was actually detached before you rely on a `cache.invalidate` to dodge its anti-cheat:

<CodeGroup>
  ```luau Example 1 theme={null}
  cache.iscached(instance: Instance): boolean
  ```

  ```luau Example 2 theme={null}
  local remote = game:GetService("ReplicatedStorage"):FindFirstChild("RemoteEvent")

  print(cache.iscached(remote)) -- expected true: reached through the game tree

  cache.invalidate(remote)

  if not cache.iscached(remote) then
      print("dropped from the cache - the next fetch is a new value")
  end
  ```
</CodeGroup>

<Tip>
  Checking cache status is helpful before performing low-level memory operations.
</Tip>
