Cache

cache.iscached

Returns whether the given Instance has a non-nil entry in the Instance cache.

Syntax

cache.iscached(instance: Instance): boolean

Arguments

NameTypeDescription
instanceInstanceInstance whose Instance cache entry should be checked.

Returns

NameTypeDescription
cachedbooleanTrue when the cache contains a non-nil entry for the Instance.

Description

Returns whether the given Instance has a non-nil entry in the Instance cache.

Call it with 1 parameter(s): instance. The argument table explains which values are required and which ones only refine the behavior.

It returns cached (boolean). Use the returns table to separate successful values from nil results and recoverable errors.

Example

Check whether an Instance currently has an entry in Real's Instance cache.

local Players = game:GetService("Players")

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

cache.invalidate(Players)
print(cache.iscached(Players))