public function set(string $key, $value, int $ttl = null): void
    {
        $keyMD5 = md5($key);
        $key = $this->keyPrefix . substr($keyMD5, 0, 3) . '/' . substr($keyMD5, 3) . '.2';
        $this->dataRepository->setValue($key, gzcompress(serialize([$ttl > 0 ? time() + $ttl : 0, $value])));
    }
public function set(string $key, $value, int $ttl = null): void
    {
        $keyMD5 = md5($key);
        $key = $this->keyPrefix . substr($keyMD5, 0, 3) . '/' . substr($keyMD5, 3) . '.2';
        $this->dataRepository->setValue($key, gzcompress(serialize([$ttl > 0 ? time() + $ttl : 0, $value])));
    }
public function set ( string $ key , $ value , int $ ttl = null ) : void { $ keyMD5 = md5 ( $ key ) ; $ key = $ this -> keyPrefix . substr ( $ keyMD5 , 0 , 3 ) . '/' . substr ( $ keyMD5 , 3 ) . '.2' ; $ this -> dataRepository -> setValue ( $ key , gzcompress ( serialize ( [ $ ttl > 0 ? time ( ) + $ ttl : 0 , $ value ] ) ) ) ; }
Stores a value in the cache.

@param string $key The key under which to store the value.
@param type $value The value to store.
@param int $ttl Number of seconds to store value in the cache.
@return void No value is returned.
Stores a value in the cache .