0) { if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false)) { $encoding = 'gzip'; } if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip') !== false)) { $encoding = 'x-gzip'; } header('Content-Encoding: ' . $encoding); } readfile($_nico_cache_file); exit; //die(file_get_contents($_nico_cache_file)); } else { if (NICO_PAGE_CACHE_GZIP == 0) { @ini_set('zlib.output_compression', 'Off'); @ini_set('output_buffering', 'Off'); @ini_set('output_handler', ''); } ob_start(); } } function nico_speed_cache_page_save() { global $_nico_cache_file, $_nico_cache_route, $_nico_page_cache_ignore; if ($_nico_page_cache_ignore) return; $html = ob_get_contents(); if (NICO_PAGE_CACHE_STRIP_EXTRA_SPACE) { $html = preg_replace('/[ \t]+/', ' ', $html); $html = str_replace("\r", "\n", $html); $html = preg_replace('/\s*\n+\s*/', "\n", $html); } file_put_contents($_nico_cache_file, $html); }