I am trying to store user\' request URL as the key and a PHP object corresponding to that key as the value in Redis. I tried the following:
$redisClient = new Re
An addition to Aliweb's answer!
Redis supports integers as well as actions like INCR, INCRBY, DECR and DECRBY.
As for the question:
Serialize only if is not a String or Int. Serialization is a costly operation!
on GET and HGET try to see what if it is serialized:
'
private function string_unserialize($str){
$data = @unserialize($str);
if ($str === 'b:0;'){
return 0;
}elseif($data !== false){
return $data;
}else {
return $str;
}
}
'