+ $cachefile = get_cachefile(hash("md5", $_REQUEST['url']));
+ if ($cachefile != '') {
+ if (file_exists($cachefile)) {
+ $img_str = file_get_contents($cachefile);
+
+ $mime = image_type_to_mime_type(exif_imagetype($cachefile));
+
+ header("Content-type: $mime");
+ header("Last-Modified: " . gmdate("D, d M Y H:i:s", time()) . " GMT");
+ header('Etag: "'.md5($img_str).'"');
+ header("Expires: " . gmdate("D, d M Y H:i:s", time() + (31536000)) . " GMT");
+ header("Cache-Control: max-age=31536000");
+
+ echo $img_str;
+
+ //if ($a->config["system"]["db_log"] != "") {
+ // $stamp2 = microtime(true);
+ // $duration = round($stamp2-$stamp1, 3);
+ // if ($duration > $a->config["system"]["db_loglimit"])
+ // @file_put_contents($a->config["system"]["db_log"], $duration."\t".strlen($img_str)."\t".$_REQUEST['url']."\n", FILE_APPEND);
+ //}
+
+ killme();
+ }
+ }
+
+ require_once("Photo.php");
+
+ $valid = true;
+