public static function cache($time = 10800) { $time = Time::toSeconds($time); header("Expires: " . self::toGmtDate(time() + $time)); header("Pragma: cache"); header("Cache-Control: max-age={$time}"); header("X-Accel-Expires : " . $time); }
/** * @param int|string $timeToCache */ public function setTimeToCache($timeToCache) { $this->timeToCache = Time::toSeconds($timeToCache); }