cache.invalidate
Invalidates cached data for an instance.
Syntax
cache.invalidate(instance?: Instance) -> nil
Parameters
| Parameter | Type | Description |
|---|---|---|
instance? | Instance | The Instance to read from or modify. |
Returns
| Type | Description |
|---|---|
nil | This function does not return a value. |
Description
cache.invalidate 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 change is applied directly to the live target, so later reads observe the updated value.
Example
cache.invalidate(workspace)
print(cache.iscached(workspace))
Notes
- Cache changes affect future lookups; existing userdata references remain valid.