private function persistHeaders(MessageInterface $message)
    {
        // Clone the response to not destroy any necessary headers when caching
        $headers = array_diff_key($message->getHeaders(), self::$noCache);

        // Cast the headers to a string
        foreach ($headers as &$value) {
            $value = implode(', ', $value);
        }

        return $headers;
    }