class Touch

Adjust the expiration time of a cached item and its tag metadata.

Any-mode tag hash fields and reverse indexes carry their own TTLs, and flush treats them as authoritative membership. A bare EXPIRE on the key would let the key outlive its tag metadata, making a later tag flush miss a still-live key.

Methods

__construct(StoreContext $context)

Create a new touch operation instance.

bool
execute(string $key, int $seconds)

Execute the touch operation.

string
touchWithTagsScript()

Get the Lua script for touching a value and its tag metadata.

Details

at line 23
__construct(StoreContext $context)

Create a new touch operation instance.

Parameters

StoreContext $context

at line 31
bool execute(string $key, int $seconds)

Execute the touch operation.

Parameters

string $key
int $seconds

Return Value

bool

at line 115
protected string touchWithTagsScript()

Get the Lua script for touching a value and its tag metadata.

KEYS[1] - The cache key (prefixed) KEYS[2] - The reverse index key ARGV[1] - TTL in seconds ARGV[2] - Tag prefix for building tag hash keys ARGV[3] - Tag registry key ARGV[4] - Current timestamp ARGV[5] - Raw key (without prefix, for hash field name) ARGV[6] - Tag hash suffix (":entries")

Return Value

string