getinstancecache
Gets all cached instance references.
Syntax
getinstancecache() -> tableReturns
| Type | Description |
|---|---|
table | Dictionary of cached instances |
Description
getinstancecache returns the internal instance cache. Keys are light userdata values and each value is its corresponding Instance.
Example
local instanceCache = getinstancecache()
local count = 0
for key, instance in pairs(instanceCache) do
count += 1
print(key, instance)
end
print("Cached instances:", count)
-- This is the same table used by the cache library
local folder = Instance.new("Folder")
print(cache.iscached(folder)) -- true
folder:Destroy()Related Functions
cache.invalidate- Remove from cachecache.replace- Replace cached instancecache.iscached- Check if cached