cacheKeyHeaderTag() value with the runtime value of the isId field from the document. Understanding this format lets you inspect or debug the cache directly with redis-cli and helps you design addons that do not interfere with each other.
Key Format
cacheKeyHeaderTag() returning "stats" and an isId field value of "Steve" produces the key stats_Steve.
Examples
Cache Entry Format
Each Redis key maps to a serialized JSON string containing the complete document. For example:SET_DATA, UPDATE_DATA, INCREMENT_DATA, and REMOVE_DATA operations.
Avoiding Key Collisions
To prevent collisions:- Use a prefix that clearly identifies both the addon and its collection (e.g.
pvp_stats,guild_data,eco_balance). - Avoid generic prefixes like
stats,data, orplayerthat other addons are likely to also use. - Maintain a central registry (alongside your addon ID constants) that lists all tags in use.
Inspecting the Cache
You can inspect live cache entries directly withredis-cli:
Related Topics
- Annotations Reference — how
isIdfields are declared - Cache Strategy — TTL, invalidation, and auto-sync
- Best Practices — distinctive prefix guidelines