Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time.
Signature
public function set(string
$key,
mixed
$value,
[DateInterval
$ttl = NULL] )
Parameters
$key
—
string
The key of the item to store.
$value
—
mixed
The value of the item to store, must be serializable.
$ttl
—
object
Optional. 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.