Beispiel #1
0
 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}");
 }
Beispiel #2
0
 /**
  * @param int|string $timeToCache
  */
 public function setTimeToCache($timeToCache)
 {
     $this->timeToCache = Time::toSeconds($timeToCache);
 }