0) { // Content has not expired header($_SERVER['SERVER_PROTOCOL'].' 304 Not Modified'); header('Last-Modified: '.gmdate('D, d M Y H:i:s T', $last_modified)); // HTTP 1.0 header('Expires: '.gmdate('D, d M Y H:i:s T', $expires)); // HTTP 1.1 header('Cache-Control: max-age='.$max_age); // Clear any output Event::add('system.display', create_function('', 'Kohana::$output = "";')); exit; } } return $last_modified; } /** * Check if expiration headers are already set * * @return boolean */ public static function headers_set() { foreach (headers_list() as $header) { if (strncasecmp($header, 'Expires:', 8) === 0 OR strncasecmp($header, 'Cache-Control:', 14) === 0 OR strncasecmp($header, 'Last-Modified:', 14) === 0) { return TRUE; } } return FALSE; } } // End expires