includes/Cache/class-cache-key.php
Cache key boundary — key construction for transients, options, salts, and stampede guards.
Class Cache_Key
Class Cache_Key
final class Cache_Keypublicstatic transient_key()
public static function transient_key(string $key): stringQualify a transient key with the current blog ID on multisite. Parameter Type Default Description $keystring— The bare transient key.
Return: string — Blog-ID-prefixed key on multisite, or the original key.
publicstatic option_key()
public static function option_key(string $key): stringQualify an option name with the current blog ID on multisite. Parameter Type Default Description $keystring— The bare option name.
Return: string — Blog-ID-prefixed option name on multisite, or the original name.
publicstatic stampede_stale_key()
public static function stampede_stale_key(string $key): stringDerive the stale-copy transient key for a guarded value key. Parameter Type Default Description $keystring— Value cache key as passed to get_with_stampede_lock().
Return: string — Stale-copy key.
publicstatic cache_salt()
public static function cache_salt(string $option): stringCurrent value of a salted-cache salt (option-backed). Parameter Type Default Description $optionstring— Option key holding the salt.
Return: string — Current salt value (\’0\’ until the first bump).