public function set($key, $value)
    {
        // take care about replacing keys !
        if (is_resource($value) || $value instanceof StreamInterface) {
            $res = file_put_contents($this->filePath($key), $value);
            if ($res !== false) {
                // clear plain storage from key
                return $this->deleteStore($key);
            }
            return $res;
        } else {
            $this->storage[$key] = $value;
            $res = $this->save();
            if ($res !== false) {
                // clear file storage from key
                return $this->deleteFile($key);
            }
            return $res;
        }
    }