Permalink
Browse files

geoTag: Optimisation - better caching of footer map images.

  • Loading branch information...
1 parent 2ce3d2a commit 973049b916018488df93f39fa0602e22165a75b0 @brockhaus brockhaus committed Jul 8, 2012
@@ -1,5 +1,5 @@
<?php
// Actual version of both plugins
-@define('PLUGIN_EVENT_GEOTAG_VERSION', '1.31');
+@define('PLUGIN_EVENT_GEOTAG_VERSION', '1.32');
@define('PLUGIN_EVENT_GEOTAG_AUTHOR', 'Zoran Kovacevic, Grischa Brockhaus, Matthias Gutjahr');
@@ -792,11 +792,17 @@ function showMap($filename) {
$fp = @fopen($filename, "rb");
if ($fp) {
+ $nextcheck = time() + (60*60*24*7); // invalidate 7 days later
+ $expires_txt = date("D, d M Y H:i:s T",(int)$nextcheck);
+
$filemtime = filemtime($filename);
header("Content-type: $mime_type");
header("Content-Length: ". filesize($filename));
header("Date: " . date("D, d M Y H:i:s T"));
header("Last-Modified: " . date("D, d M Y H:i:s T", $filemtime), true);
+ header("Cache-Control: public, max-age=" . ((int)$nextcheck - time()) , true);
+ header("Expires: $expires_txt". true);
+ header("Pragma:", true);
fpassthru($fp);
fclose($fp);
}

0 comments on commit 973049b

Please sign in to comment.