From f3a9e46bcec548382af8ece15562af892a625f1b Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Fri, 23 May 2008 10:40:38 +0000 Subject: [PATCH] Static files never expires git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@411 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- _compile.php | 33 ++++++++++++++------------------- design.inc.php | 2 +- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/_compile.php b/_compile.php index 8959437f..7d1bbd1c 100644 --- a/_compile.php +++ b/_compile.php @@ -86,26 +86,21 @@ $file = preg_replace("~favicon\\.ico|default\\.css|(up|down|plus|minus)\\.gif~", $file = str_replace("arrow.gif", '" . preg_replace("~\\\\?.*~", "", $_SERVER["REQUEST_URI"]) . "?file=arrow.gif', $file); $file = str_replace('error_reporting(E_ALL & ~E_NOTICE);', 'error_reporting(E_ALL & ~E_NOTICE); if (isset($_GET["file"])) { - $last_modified = filemtime(__FILE__); - if ($_SERVER["HTTP_IF_MODIFIED_SINCE"] && $last_modified <= strtotime($_SERVER["HTTP_IF_MODIFIED_SINCE"])) { - header("HTTP/1.1 304 Not Modified"); + header("Expires: " . gmdate("D, d M Y H:i:s", filemtime(__FILE__) + 365*24*60*60) . " GMT"); + if ($_GET["file"] == "favicon.ico") { + header("Content-Type: image/x-icon"); + echo base64_decode("' . base64_encode(file_get_contents("favicon.ico")) . '"); + } elseif ($_GET["file"] == "default.css") { + header("Content-Type: text/css"); + ?>' . file_get_contents("default.css") . '' . file_get_contents("default.css") . ' -<?php echo $title . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . " - " . lang('phpMinAdmin') . " 1.6.1"; ?> +<?php echo $title . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . " - " . lang('phpMinAdmin') . " 1.6.2-dev"; ?>