cache.iscached

Checks if an instance is in the reference cache.

Syntax

cache.iscached(instance: Instance) -> boolean

Parameters

ParameterTypeDescription
instanceInstanceThe instance to check

Returns

TypeDescription
booleanTrue if the instance is cached

Description

cache.iscached checks whether an instance currently exists in the reference cache.

Example

local folder = Instance.new("Folder")

print(cache.iscached(folder)) -- true

-- After invalidation
cache.invalidate(folder)
print(cache.iscached(folder)) -- false

folder:Destroy()