protected function setResponseMaxAge(Response $response, $status, $maxAge, $hasEsi)
    {
        if (-1 === $maxAge) {
            $maxAge = 2629743;
        }
        if (true === $hasEsi && CacheableInterface::CACHE_PUBLIC == $status) {
            $response->setSharedMaxAge($maxAge);
        } else {
            $response->setMaxAge($maxAge);
        }
    }