Yuari
Documentation
Docs/Cache/cache.validate

cache.validate

Re-inserts an instance into the cache so future lookups reuse the same userdata.

Syntax

cache.validate(instance: Instance) -> nil

Parameters

ParameterTypeDescription
instanceInstanceThe Instance to read from or modify.

Returns

TypeDescription
nilThis function does not return a value.

Description

cache.validate is part of the Cache library. The module keeps a stable instance cache so userdata survives Roblox object churn. Cache calls inspect or change that mapping without modifying the game object itself.

The operation is performed immediately using the arguments supplied at the call site.

Example

local part = Instance.new("Part")
cache.invalidate(part)
print(cache.iscached(part))
cache.validate(part)
print(cache.iscached(part))

Notes

  • Cache changes affect future lookups; existing userdata references remain valid.