> ## 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.iscached

> 返回给定 Instance 在 Instance cache 中是否有 non-nil 条目。

<div className="real-function-page">
  ```lua theme={null}
  cache.iscached(instance: Instance): boolean
  ```

  ## 参数

  <ParamField path={"instance"} type={"Instance"} required>
    要检查其 Instance cache 条目的 Instance。
  </ParamField>

  ## 返回值

  <ResponseField name={"cached"} type={"boolean"}>
    当 cache 包含该 Instance 的 non-nil 条目时返回 True。
  </ResponseField>

  ## 示例

  检查一个 Instance 当前是否在 Real 的 Instance cache 中有条目。

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

  local cached = cache.iscached(Players)
  print(cached)

  cache.invalidate(Players)
  print(cache.iscached(Players))
  ```
</div>
