Set the maximum age of this page in web caches, in seconds.

@deprecated 4.2.0:5.0.0 Use HTTPCacheControlMiddleware::singleton()->setMaxAge($age) instead
@param int $age
765876
public static function set_cache_age($age)
    {
        Deprecation::notice('5.0', 'Use HTTPCacheControlMiddleware::singleton()->setMaxAge($age) instead');
        self::$cache_age = $age;
        HTTPCacheControlMiddleware::singleton()->setMaxAge($age);
    }
270321
public function setCacheHeader()
    {
        if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
            $this->setStatus(304);
            exit;
        }

        $this->setHeader('Expires', gmdate('D, d M Y H:i:s', time() + 365 * 24 * 60 * 60) . ' GMT');
        $this->setHeader('Last-Modified', gmdate('D, d M Y H:i:s') . ' GMT');
        $this->setHeader('Cache-Control', 'immutable');
    }
508258
public function setMaxHeight($maxHeight)
    {
        $maxHeight = (int) $maxHeight;
        $this->maxHeight = $maxHeight > 0 ? $maxHeight : null;
    }
60092
public function setMaxQueryTime($max)
    {
        assert(is_int($max));
        assert($max >= 0);
        $this->_maxquerytime = $max;

        return $this;
    }
855675
public function getMaxAge()
    {
        if ($header = $this->getHeader('Cache-Control')) {
            // s-max-age, then max-age, then Expires
            if ($age = $header->getDirective('s-maxage')) {
                return $age;
            }
            if ($age = $header->getDirective('max-age')) {
                return $age;
            }
        }

        if ($this->getHeader('Expires')) {
            return strtotime($this->getExpires()) - time();
        }

        return null;
    }
1287076
public function setMaxTime(QtiDuration $maxTime = null)
    {
        // Prevent to get 0s durations stored.
        if (is_null($maxTime) === false && $maxTime->getSeconds(true) === 0) {
            $maxTime = null;
        }

        $this->maxTime = $maxTime;
    }
1089371
public function setSharedMaxAge($value): void
    {
        $this->setPublic();
        $this->doSetContainer('s-maxage', $value);
        $this->updateCacheControlHeader();
    }
1246558
function setYear( $year )
    {
        $arr = getdate( $this->DateTime );
        $this->DateTime = mktime( $arr['hours'], $arr['minutes'], $arr['seconds'],
                                  $arr['mon'], $arr['mday'], $year );
    }
469685
protected function expiration($key)
	{
		$lifetime = ini_get("session.gc_maxlifetime");

		$expire = $this->engine->get($key . '_expire');

		// Set prune period
		if ($expire + $lifetime < time())
		{
			$this->engine->delete($key);
			$this->engine->delete($key . '_expire');
		}
		else
		{
			$this->engine->replace($key . '_expire', time());
		}
	}
268058
public function setMaxPerPage($max)
    {
        if ($max > 0) {
            $this->maxPerPage = $max;
            if (0 === $this->page) {
                $this->page = 1;
            }
        } elseif (0 === $max) {
            $this->maxPerPage = 0;
            $this->page = 0;
        } else {
            $this->maxPerPage = 1;
            if (0 === $this->page) {
                $this->page = 1;
            }
        }
    }
179214
public function setDirectives($directives)
    {
        parent::setDirectives($directives);
        $lifetime = $this->getLifetime(false);
        if ($lifetime > 2592000) {
            // #ZF-3490 : For the memcached backend, there is a lifetime limit of 30 days (2592000 seconds)
            $this->_log('memcached backend has a limit of 30 days (2592000 seconds) for the lifetime');
        }
        if ($lifetime === null) {
            // #ZF-4614 : we tranform null to zero to get the maximal lifetime
            parent::setDirectives(array('lifetime' => 0));
        }
    }
979018
public void setExtractionCacheMaxAge(String extractionCacheMaxAge) {

        try {
            setExtractionCacheMaxAge(Float.parseFloat(extractionCacheMaxAge));
        } catch (NumberFormatException e) {
            LOG.error(
                Messages.get().getBundle().key(
                    Messages.LOG_PARSE_EXTRACTION_CACHE_AGE_FAILED_2,
                    extractionCacheMaxAge,
                    new Float(DEFAULT_EXTRACTION_CACHE_MAX_AGE)),
                e);
            setExtractionCacheMaxAge(DEFAULT_EXTRACTION_CACHE_MAX_AGE);
        }
    }
133813
public function setCookie($code)
    {
        $lifespan = $this->config->get('currency_cookie_lifespan', 365 * 24 * 60 * 60);
        $this->request->setCookie('currency', $code, $lifespan);
    }
833164
public function expire(): self
    {
        if ($this->getTtl() > 0) {
            $this->header->set('Age', $this->getMaxAge());
        }

        return $this;
    }
996673
public function setMax($max)
    {
        if (is_numeric($max) || Format::isVariableRef($max)) {
            $this->max = $max;
        } else {
            $msg = "'Max must be a numeric value or a variableRef, '" . gettype($max) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
758096
public function setCacheable($minutes)
    {
        if ($minutes <= 0) {
            $this->setHeader('Cache-Control', 'private, no-cache, no-store, must-revalidate');
            $this->setHeader('Expires', '-1');
            $this->setHeader('Pragma', 'no-cache');
        } else {
            $this->setHeader('Expires', gmdate('D, d M Y H:i:s', time() + $minutes * 60) . ' GMT', true);
            $this->setHeader('Cache-Control', 'max-age=' . $minutes * 60, true);
            $this->setHeader('Pragma', 'public', true);
        }
    }
396281
def getMaxAge(self):
        ""
        max_age = 0
        cache_control = self.headers.get('cache-control')
        if cache_control:
            params = dict(urlparse.parse_qsl(cache_control))
            max_age = int(params.get('max-age', '0'))
        return max_age