Volt

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 part = workspace.Part

if cache.iscached(part) then
    print("Part is cached")
else
    print("Part is not cached")
end

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

On this page