554 B
554 B
trigger
| trigger |
|---|
| always_on |
Redis Rules
- Format:
{app}:{layer}:{entity}:{action}:{id}(e.g.,app:cache:user:123) - Rules: All lowercase, separated by colons
:, max 50 chars. - Mandatory TTL: Every key MUST have an expiration time to avoid memory leaks.
- Commands: Use
SCAN,HSCAN,SSCAN. NEVER useKEYS *(blocks server). - Structures: Use
Hashfor objects,Stringfor simple values/JSON,Set/Listfor collections. - Invalidation: Use tags (e.g.,
app:tags:user) to group and delete related cache keys.