From 206aab8bf2a0fff87e5453eaeb4545bacd63ee36 Mon Sep 17 00:00:00 2001 From: Hannes Magnusson Date: Fri, 6 Dec 2013 17:00:35 -0800 Subject: [PATCH] Cache the images for a day --- images/elephpants.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/images/elephpants.php b/images/elephpants.php index 88d4185c0..f9578786f 100644 --- a/images/elephpants.php +++ b/images/elephpants.php @@ -1,5 +1,21 @@ $now) { + header("HTTP/1.1 304 Not Modified"); + exit; + } +} +$future = strtotime("+1 day", $now); +$tsstring = gmdate("D, d M Y H:i:s ", $now) . "GMT"; +header("Last-Modified: " . $tsstring); +header("Expires: " . date(DATE_RSS, $future)); + /* Simple script to serve elephpant images in json format.