Skip to content

Cache Management Functions ​

ClearCache() ​

ClearCache() → void

Kept for compatibility. Since v2.0.1 the client no longer keeps a value cache: Get, GetPath, GetFromDict, GetShared and GetSharedPath read the live replicated data directly and always return the latest value. Calling ClearCache() is safe but has little or no effect.

Parameters: None
Returns: Nothing

Example
lua
-- Safe to call, but not needed: reads are always live
PlayerState.ClearCache()

local coins = PlayerState.Get("Coins")

Note

You don't need to call this to get fresh values. CacheDuration, CacheCleanupInterval and MaxCacheSize in the client config are still accepted but no longer do anything. The server's ClearPathCache() is separate and unchanged.

PlayerState - High-Performance Roblox Data Management