public function setCacheableIdentifier(string $id = null, int $length = null): self
    {
        if ($id) {
            if (!preg_match('/^[a-zA-Z0-9\_\-\~\.]{8,32}$/', $id)) {
                throw new CacheException('Invalid value passed to "setCacheableIdentifier" method');
            }

            $this->cacheableId = $id;
            $this->cacheableIdLength = strlen($id);
        }

        if ($length) {
            if ($length < 100 || $length <= $this->cacheableIdLength) {
                throw new CacheException('Length of encoded Cacheable objects must start from at least 100');
            }

            $this->cacheableLengthFrom = $length;
        }

        return $this;
    }