class Touch

Adjust the expiration time of a tagged cache item and its tag entries.

All-mode tag ZSET scores are the authoritative expiry used by stale pruning. A bare EXPIRE on the item key would desynchronize the scores: pruning would drop the entry while the key lives, and a later tag flush would miss it.

Methods

__construct(StoreContext $context)

Create a new touch operation instance.

bool
execute(string $key, int $seconds, array $tagIds)

Execute the touch operation.

string
touchTaggedScript()

Get the Lua script for touching a tagged value and its ZSET scores.

Details

at line 25
__construct(StoreContext $context)

Create a new touch operation instance.

Parameters

StoreContext $context

at line 35
bool execute(string $key, int $seconds, array $tagIds)

Execute the touch operation.

Parameters

string $key
int $seconds
array $tagIds

Array of tag identifiers

Return Value

bool

at line 101
protected string touchTaggedScript()

Get the Lua script for touching a tagged value and its ZSET scores.

KEYS[1] - The cache key (prefixed, namespaced) KEYS[2...] - Prefixed tag ZSET keys ARGV[1] - TTL in seconds ARGV[2] - New expiry score ARGV[3] - Raw namespaced key (ZSET member)

Return Value

string