How to set the correct lifetime for an object in redis? To write data using class yii \ redis \ ActiveRecord

Config:

'redis' => [ 'class' => 'yii\redis\Connection', 'hostname' => 'localhost', 'port' => 6379, 'database' => 0, ], 

    1 answer 1

    The lifetime is set when the key is created by the third function parameter addValue() or setValue()

     $redis->setValue('key', 'value', 3600);