Cake\Network\Response::maxAge PHP Method

maxAge() public method

The max-age is the number of seconds after which the response should no longer be considered a good candidate to be fetched from the local (client) cache. If called with no parameters, this function will return the current max-age value if any
public maxAge ( integer | null $seconds = null ) : integer | null
$seconds integer | null if null, the method will return the current max-age value
return integer | null
    public function maxAge($seconds = null)
    {
        if ($seconds !== null) {
            $this->_cacheDirectives['max-age'] = $seconds;
            $this->_setCacheControl();
        }
        if (isset($this->_cacheDirectives['max-age'])) {
            return $this->_cacheDirectives['max-age'];
        }
        return null;
    }