geoTag: Optimisation - better caching of footer map images.

This commit is contained in:
Grischa Brockhaus 2012-07-08 13:34:56 +02:00
parent 2ce3d2ae74
commit 973049b916
2 changed files with 7 additions and 1 deletions

View file

@ -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');

View file

@ -792,11 +792,17 @@ class serendipity_event_geotag extends serendipity_event
$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);
}