TagKeyBuilder
class TagKeyBuilder
Builds Redis-internal tag storage key names.
Keeping key formats here centralizes Redis implementation details while allowing the TagMode enum to remain purely semantic.
Methods
Create a new tag key builder instance.
Mode-only tag segment, for callers that don't have a prefix to hand (e.g. console tools that concatenate a cachePrefix externally).
Tag segment prefix: "_any:tag:" or "_all:tag:".
Tag identifier (without cache prefix): "_any:tag:{tagName}:entries".
Full tag key with cache prefix: "{prefix}_any:tag:{tagName}:entries".
Full reverse index key: "{prefix}{cacheKey}:_any:tags".
Full registry key: "{prefix}_any:tag:registry".
Details
at line 20
__construct(TagMode $mode, string $prefix)
Create a new tag key builder instance.
at line 30
static string
tagSegmentFor(TagMode $mode)
Mode-only tag segment, for callers that don't have a prefix to hand (e.g. console tools that concatenate a cachePrefix externally).
at line 38
string
tagSegment()
Tag segment prefix: "_any:tag:" or "_all:tag:".
at line 46
string
tagId(string $tagName)
Tag identifier (without cache prefix): "_any:tag:{tagName}:entries".
at line 54
string
tagKey(string $tagName)
Full tag key with cache prefix: "{prefix}_any:tag:{tagName}:entries".
at line 64
string
reverseIndexKey(string $cacheKey)
Full reverse index key: "{prefix}{cacheKey}:_any:tags".
Any mode uses this to track which tags a cache key belongs to.
at line 74
string
registryKey()
Full registry key: "{prefix}_any:tag:registry".
Any mode uses this as a sorted set of all active tags.