public static function cache($time = 10800) { $time = Time::toSeconds($time); $ts = gmdate("D, d M Y H:i:s", time() + $time) . " GMT"; header("Expires: {$ts}"); header("Pragma: cache"); header("Cache-Control: max-age={$time}"); }
/** * @param int|string $timeToCache */ public function setTimeToCache($timeToCache) { $this->timeToCache = Time::toSeconds($timeToCache); }