private function isCacheable($method, $uri, array $options, $response)
    {
        /** @var ResponseInterface $statusCode */
        $statusCode = $response->getStatusCode();

        //cache only 2** responses
        if ($statusCode < 200 || $statusCode >= 300) {
            return false;
        }

        //GET is always safe to cache
        if ('GET' === $method) {
            return true;
        }

        //POST may be cached for certain endpoints only (forgive us Roy Fielding)
        if ('POST' === $method) {
            return in_array($uri, self::CACHEABLE_POST_ENDPOINTS);
        }

        //assume not cacheable in all other cases
        return false;
    }