Rashp Posted October 25, 2024 at 02:53 PM Share Posted October 25, 2024 at 02:53 PM Всем, привет, помогите плз. мозгов не хватает прикрутить в header.twig <meta http-equiv="expires" content="{{ expires }}"> <meta http-equiv="last-modified" content="{{ last_modified }}"> сделал в catalog/controller/common/lastmodified.php <?php // Установите заголовки $Expires = @date('D, d M Y H:i:00', time() + 360000); $num = mt_rand(2000, 10000); $LastModified = gmdate("D, d M Y H:i:s \G\M\T", time() - $num); $IfModifiedSince = false; if (isset($_ENV['HTTP_IF_MODIFIED_SINCE'])) $IfModifiedSince = strtotime(substr($_ENV['HTTP_IF_MODIFIED_SINCE'], 5)); if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) $IfModifiedSince = strtotime(substr($_SERVER['HTTP_IF_MODIFIED_SINCE'], 5)); if ($IfModifiedSince && $IfModifiedSince >= $num) { header($_SERVER['SERVER_PROTOCOL'] . ' 304 Not Modified'); exit; } Установка заголовков header('Expires: ' . $Expires); header('Last-Modified: ' . $LastModified); Загрузка и рендеринг шаблона Twig $this->load->view('common/header', $data); ?> но последний блок не работает чтоб зацепить его в header подскажите плз. Заранее благодарен 0 Quote Link to comment Share on other sites More sharing options...
Blast Posted October 27, 2024 at 06:53 PM Share Posted October 27, 2024 at 06:53 PM last_modified.ocmod.xml 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.