aboutsummaryrefslogtreecommitdiff
path: root/thumbnail.php
diff options
context:
space:
mode:
Diffstat (limited to 'thumbnail.php')
-rw-r--r--thumbnail.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/thumbnail.php b/thumbnail.php
index eaca0849f..f310aee95 100644
--- a/thumbnail.php
+++ b/thumbnail.php
@@ -60,10 +60,19 @@
if (!$contents) {
forward('mod/tidypics/graphics/' . $error_image);
}
+
+ // expires every 14 days
+ $expires = 14 * 60*60*24;
- // Return the thumbnail and exit
+ // overwrite header caused by php session code so images can be cached
$mime = $file->getMimeType();
- header("Content-type: $mime");
+ header("Content-Type: $mime");
+ header("Content-Length: " . strlen($contents));
+ header("Cache-Control: public", true);
+ header("Pragma: public", true);
+ header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $expires) . ' GMT', true);
+
+ // Return the thumbnail and exit
echo $contents;
exit;
?>