ReferenceInstances

cache.invalidate

Removes an Instance’s cached Luau reference.

Syntax

cache.invalidate(object: Instance) -> ()

Also available as

cache_invalidate

Parameters

ParameterTypeDescription
objectInstanceInstance whose cached reference to discard.

Description

Later engine lookups can create a new reference for the same underlying Instance. Existing references remain usable. This does not destroy the Instance or replace its properties. Use compareinstances when comparing references to the underlying object.

Example

local folder = Instance.new("Folder", workspace)
cache.invalidate(folder)
folder:Destroy()

These are Game executor contracts. Check build requirements and session lifetimes before using them.