WordPress\AiClientDependencies\Psr\SimpleCache

CacheInterface::setpublicWP 1.0

Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time.

Method of the class: CacheInterface{}

No Hooks.

Returns

true|false. True on success and false on failure.

Usage

$CacheInterface = new CacheInterface();
$CacheInterface->set( $key, $value, $ttl );
$key(string) (required)
The key of the item to store.
$value(mixed) (required)
The value of the item to store, must be serializable.
$ttl(null|int|\DateInterval)
The TTL value of this item. If no value is sent and the driver supports TTL then the library may set a default value for it or let the driver take care of that.
Default: null

CacheInterface::set() code WP 7.0

public function set($key, $value, $ttl = null);