Permalink
Browse files

Static files never expires

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@411 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent 92eb0d1 commit f3a9e46bcec548382af8ece15562af892a625f1b jakubvrana committed May 23, 2008
Showing with 15 additions and 20 deletions.
  1. +14 −19 _compile.php
  2. +1 −1 design.inc.php
View
@@ -86,26 +86,21 @@ function php_shrink($input) {
$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") . '<?php
} else {
- header("Last-Modified: " . gmdate("D, d M Y H:i:s", $last_modified) . " 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") . '<?php
- } else {
- header("Content-Type: image/gif");
- switch ($_GET["file"]) {
- case "arrow.gif": echo base64_decode("' . base64_encode(file_get_contents("arrow.gif")) . '"); break;
- case "up.gif": echo base64_decode("' . base64_encode(file_get_contents("up.gif")) . '"); break;
- case "down.gif": echo base64_decode("' . base64_encode(file_get_contents("down.gif")) . '"); break;
- case "plus.gif": echo base64_decode("' . base64_encode(file_get_contents("plus.gif")) . '"); break;
- case "minus.gif": echo base64_decode("' . base64_encode(file_get_contents("minus.gif")) . '"); break;
- }
+ header("Content-Type: image/gif");
+ switch ($_GET["file"]) {
+ case "arrow.gif": echo base64_decode("' . base64_encode(file_get_contents("arrow.gif")) . '"); break;
+ case "up.gif": echo base64_decode("' . base64_encode(file_get_contents("up.gif")) . '"); break;
+ case "down.gif": echo base64_decode("' . base64_encode(file_get_contents("down.gif")) . '"); break;
+ case "plus.gif": echo base64_decode("' . base64_encode(file_get_contents("plus.gif")) . '"); break;
+ case "minus.gif": echo base64_decode("' . base64_encode(file_get_contents("minus.gif")) . '"); break;
}
}
exit;
View
@@ -9,7 +9,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta name="robots" content="noindex" />
-<title><?php echo $title . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . " - " . lang('phpMinAdmin') . " 1.6.1"; ?></title>
+<title><?php echo $title . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . " - " . lang('phpMinAdmin') . " 1.6.2-dev"; ?></title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="default.css" /><?php // Ondrej Valka, http://valka.info ?>
<?php if ($_COOKIE["highlight"] == "jush") { ?>

0 comments on commit f3a9e46

Please sign in to comment.