protected function save(CacheItemInterface $item, $value, $ttl = null)
    {
        if ($ttl === null) {
            $ttl = $this->defaultTtl();
        }

        if (is_numeric($ttl) || ($ttl instanceof \DateInterval)) {
            $item->expiresAfter($ttl);
        } elseif ($ttl instanceof \DateTimeInterface) {
            $item->expiresAt($ttl);
        }

        $item->set($value);

        return $this->cachePool()->save($item);
    }