Response::getTtl()

int|null getTtl() Returns the response's time-to-live in seconds. It returns null when no freshness information is present in the response. When the responses TTL is <= 0, the response may not be served from cache without first revalidating with the origin. Return Value int|null The TTL in seconds

Response::getMaxAge()

int|null getMaxAge() Returns the number of seconds after the time specified in the response's Date header when the response should no longer be considered fresh. First, it checks for a s-maxage directive, then a max-age directive, and then it falls back on an expires header. It returns null when no maximum age can be established. Return Value int|null Number of seconds

Response::getProtocolVersion()

string getProtocolVersion() Gets the HTTP protocol version. Return Value string The HTTP protocol version

Response::getExpires()

DateTime|null getExpires() Returns the value of the Expires header as a DateTime instance. Return Value DateTime|null A DateTime instance or null if the header does not exist

Response::getHeader()

string|array getHeader(string $header, bool $first = true) Gets a response header. Parameters string $header The header name bool $first Whether to return the first value or all header values Return Value string|array The first header value if $first is true, an array of values otherwise

Response::getEtag()

string|null getEtag() Returns the literal value of the ETag HTTP header. Return Value string|null The ETag HTTP header or null if it does not exist

Response::getHeaders()

array getHeaders() Gets the response headers. Return Value array The response headers

Response::getLastModified()

DateTime|null getLastModified() Returns the Last-Modified HTTP header as a DateTime instance. Return Value DateTime|null A DateTime instance or null if the header does not exist Exceptions RuntimeException When the HTTP header is not parseable

Response::getContent()

string getContent() Gets the current response content. Return Value string Content

Response::getCharset()

string getCharset() Retrieves the response charset. Return Value string Character set