Cache
A named cache object returned by CacheService:CreateCache(). Stores key-value pairs with an age limit and entry limit.
Functions
Get
Cache:Get(index: string--
The cache key to look up
) → any?--
The cached value, or nil if missing or expired
Returns the cached value at the given index, or nil if the entry is
missing or expired.
GetOrAdd
Cache:GetOrAdd(index: string,--
The cache key to look up
addCallback: function--
Called to produce the value if not cached
) → any?--
The cached or newly produced value
Returns the cached value at the given index. If it is missing or expired,
calls addCallback to produce a value, caches it, and returns it.
Set
Cache:Set(index: string,--
The cache key to store the value under
data: any--
The value to cache
) → ()Stores the given value at the specified index.