]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #4142. Also added ETag in group icon.
authorSem <sembrestels@riseup.net>
Tue, 3 Jan 2012 15:14:31 +0000 (16:14 +0100)
committerCash Costello <cash.costello@gmail.com>
Sat, 7 Jan 2012 16:58:54 +0000 (11:58 -0500)
mod/groups/icon.php

index f4c0f80109f105e4d83294d235bd925f78be4a93..607f389393f3f5edc5b18a9e9057a6a9cacf4f2a 100644 (file)
@@ -10,6 +10,13 @@ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
 $group_guid = get_input('group_guid');
 $group = get_entity($group_guid);
 
+// If is the same eTag, content didn't changed.
+$eTag = $group->icontime . $group_guid;
+if (trim($_SERVER['HTTP_IF_NONE_MATCH']) == $eTag) {
+       header("HTTP/1.1 304 Not Modified");
+       exit;
+}
+
 $size = strtolower(get_input('size'));
 if (!in_array($size,array('large','medium','small','tiny','master','topbar')))
        $size = "medium";
@@ -37,4 +44,5 @@ header('Expires: ' . date('r',time() + 864000));
 header("Pragma: public");
 header("Cache-Control: public");
 header("Content-Length: " . strlen($contents));
+header("ETag: $eTag");
 echo $contents;