Can we get all cache key entries made from `localcachePut`?

Looking at the API, the only available functions are:

localcacheGet(key: string)
localcachePut(key: string, value: any, ttl?: number)
localcacheDelete(key: string)
localcacheClear()

Is there no way to get an array of all cache keys? For example something like:

localcacheGetAllKeys()

If not, could it be introduced in a future Nakama version?

Hello @KamilDev,

Can you elaborate on why you’d need to list all keys? What are you using the cache for?

Best.

I’d like to enumerate over them, for example get only cache keys that have a specific prefix (e.g. equipment_templates_v) to clear all versions of cached equipment_templates.

I’m still just experimenting, perhaps it’s not the best approach. Here are my related posts: