Forever
class Forever
Store an item in the cache indefinitely with tags support.
Stores the cache key and tag hash fields WITHOUT expiration (TTL = -1). Items must be manually deleted or flushed via tags.
Optimization: Uses Lua script to perform set, tag cleanup (remove from old), and tag addition (add to new) in a single network round trip (1 RTT).
Methods
Create a new forever with tags operation instance.
Execute the forever operation.
Get the Lua script for storing a value forever with tag tracking.
Details
at line 25
__construct(StoreContext $context, Serialization $serialization)
Create a new forever with tags operation instance.
at line 39
bool
execute(string $key, mixed $value, array $tags)
Execute the forever operation.
at line 155
protected string
storeForeverWithTagsScript()
Get the Lua script for storing a value forever with tag tracking.
KEYS[1] - The cache key (prefixed) KEYS[2] - The reverse index key (tracks which tags this key belongs to) ARGV[1] - Serialized value ARGV[2] - Tag prefix for building tag hash keys ARGV[3] - Tag registry key ARGV[4] - Raw key (without prefix, for hash field name) ARGV[5] - Tag hash suffix (":entries") ARGV[6...] - Tag names