get("{$key}_modified"); if (!empty($_SERVER["HTTP_IF_MODIFIED_SINCE"]) && !empty($modified)) { header('HTTP/1.0 304 Not Modified'); return; } $content = ""; if (strpos($_SERVER["HTTP_ACCEPT_ENCODING"], "gzip") !== false ) { $content = $cache->get("{$key}_gz"); } if (empty($content)) { $content = $cache->get($key); } if (empty($content)) { Kohana::show_404(); } if (strpos($_SERVER["HTTP_ACCEPT_ENCODING"], "gzip") !== false) { header("Content-Encoding: gzip"); header("Cache-Control: private, x-gzip-ok=\"public\""); } header("Content-Type: text/javascript; charset=UTF-8"); header("Expires: " . gmdate(21474383647)); header("Last-Modified: " . $modified); Kohana::close_buffers(false); $handle = fopen("php://output", "wb"); fwrite($handle, $content); fclose($handle); } }