system/Cache/Handlers/RedisHandler.php
public function save(string $key, $value, int $ttl = 60)
	{
		$key = $this->prefix . $key;

		switch ($data_type = gettype($value))
		{
			case 'array':
			case 'object':
				$value = serialize($value);
				break;
			case 'boolean':
			case 'integer':
			case 'double': // Yes, 'double' is returned and NOT 'float'
			case 'string':
			case 'NULL':
				break;
			case 'resource':
			default:
				return false;
		}

		if (! $this->redis->hMSet($key, ['__ci_type' => $data_type, '__ci_value' => $value]))
		{
			return false;
		}
		elseif ($ttl)
		{
			$this->redis->expireAt($key, time() + $ttl);
		}

		return true;
	}
public function save(string $key, $value, int $ttl = 60)
	{
		$key = $this->prefix . $key;

		switch ($data_type = gettype($value))
		{
			case 'array':
			case 'object':
				$value = serialize($value);
				break;
			case 'boolean':
			case 'integer':
			case 'double': // Yes, 'double' is returned and NOT 'float'
			case 'string':
			case 'NULL':
				break;
			case 'resource':
			default:
				return false;
		}

		if (! $this->redis->hMSet($key, ['__ci_type' => $data_type, '__ci_value' => $value]))
		{
			return false;
		}
		elseif ($ttl)
		{
			$this->redis->expireAt($key, time() + $ttl);
		}

		return true;
	}
Saves an item to the cache store.

@param string  $key   Cache item name
@param mixed   $value The data to save
@param integer $ttl   Time To Live, in seconds (default 60)

@return mixed