MySLP_Cache_Valkey
in package
Dedicated application-cache connection; never reads or writes PHP session keys.
MYSLP_CUSTOMER_CACHE_CONFIG (array) or the myslp_customer_cache_config filter can override enabled, endpoint, mode, seeds, database, username, password, timeout, read_timeout, context, namespace, max_entries and max_bytes. By default only the connection settings are borrowed from PHP's session INI.
Example wp-config.php override (credentials belong in environment configuration): define( 'MYSLP_CUSTOMER_CACHE_CONFIG', array( 'endpoint' => 'tls://cache.internal:6379', 'mode' => 'cluster', 'namespace' => 'dashboard-production', 'max_entries' => 128, 'max_bytes' => 8 * 1024 * 1024, ) ); Set enabled=false to bypass caching. Payload budgets exclude Valkey key overhead. No persistent WordPress object-cache drop-in or session-handler changes are needed.
Table of Contents
Properties
- $attempted : bool
- $client : Redis|RedisCluster|null
- $config : array<string|int, mixed>
Methods
- __construct() : mixed
- available() : bool
- Lazy, short-timeout connection. Cache failures must not fail REST requests.
- configuration() : array<string|int, mixed>
- Explicit settings override session-server discovery without altering sessions.
- evaluate() : mixed
- Run an atomic operation. All supplied keys must share a cluster hash tag.
- failed() : void
- Do not log endpoints, credentials, cached customer data, or session values.
Properties
$attempted
private
bool
$attempted
= \false
$client
private
Redis|RedisCluster|null
$client
= \null
$config
private
array<string|int, mixed>
$config
Methods
__construct()
public
__construct(array<string|int, mixed> $config) : mixed
Parameters
- $config : array<string|int, mixed>
available()
Lazy, short-timeout connection. Cache failures must not fail REST requests.
public
available() : bool
Return values
boolconfiguration()
Explicit settings override session-server discovery without altering sessions.
public
static configuration() : array<string|int, mixed>
Return values
array<string|int, mixed>evaluate()
Run an atomic operation. All supplied keys must share a cluster hash tag.
public
evaluate(string $script, array<string|int, mixed> $keys[, array<string|int, mixed> $arguments = array() ]) : mixed
Parameters
- $script : string
- $keys : array<string|int, mixed>
- $arguments : array<string|int, mixed> = array()
failed()
Do not log endpoints, credentials, cached customer data, or session values.
private
failed() : void