есть код: PHP: <?php // Подключаем транслит include('translit.php'); $rawurldecode = rawurldecode( $_SERVER['REQUEST_URI'] ); // Перевод кириллицы в транслит $name = translit($rawurldecode); // убираем все / и меняем их на $file_cache = preg_replace ('/\//isU' , '', $name); // удаляем последний $file_caches = rtrim ($file_cache, ''); // дважды шифруем кешовый файл $encoded = md5(md5(trim($file_caches))); $cachefile = 'cache/cache' . $encoded . '.html'; $cachetime = 86400; // вывод header HTTP $last_modified_time = filemtime($cachefile); $etag = md5_file($cachefile); header("Date: ".gmdate("D, d M Y H:i:s GMT")); header("Content-Type: text/html; charset=UTF-8"); header("Content-Length: ".filesize($cachefile)); header("Last-Modified: ".gmdate("D, d M Y H:i:s", $last_modified_time)." GMT"); header("Etag: $etag"); if (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $last_modified_time || trim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag) { header("HTTP/1.1 304 Not Modified"); exit; } header("Expires: ".gmdate("D, d M Y H:i:s", strtotime("now +1 days")." GMT")); header("Content-Encoding: gzip"); header("Vary: Accept-Encoding,User-Agent"); // Обслуживается из файла кеша, если время запроса меньше if (file_exists($cachefile) && time() - $cachetime < filemtime($cachefile)) { echo "<!-- Cached copy, generated ".date('d.m.Y - H:i', filemtime($cachefile))." -->\n"; include($cachefile); exit; } ob_start(); // Запуск буфера вывода ?> и ответ сервера: Код (Text): HTTP/1.1 200 OK Server: nginx/1.10.2 Date: Sat, 12 Nov 2016 22:49:47 GMT Content-Type: text/html; charset=UTF-8 Content-Length: 16468 Connection: keep-alive X-Powered-By: PHP/7.0.12 Cache-Control: max-age=86400, private, must-revalidate Expires: Sun, 13 Nov 2016 22:49:47 Last-Modified: Sat, 12 Nov 2016 19:20:40 GMT Etag: 45da776f40c842c422da345225abe9f1 Если (вывод header HTTP) вставить перед (Обслуживается из файла кеша, если время запроса меньше) то при ответе сервера заголовки отображаются, но выводимая страница с кэша отображается не вся, либо верх либо низ исчезает, а если (вывод header HTTP) вставить в других местах, то сервер ничего не выдает, а страница наоборот отображается корректно...
отладка/debug http://phpfaq.ru/debug https://netbeans.org/kb/docs/php/debugging_ru.html https://php.ru/forum/threads/howto-...i-po-shagam-i-s-kartinkami.58974/#post-474550