aboutsummaryrefslogtreecommitdiff
path: root/engine/handlers
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-01-12 16:15:16 +0100
committerSem <sembrestels@riseup.net>2012-01-12 16:15:16 +0100
commitcc544cfa2086e418318a899ffd550adfb744c7ba (patch)
tree6c04fbe2e3df67513aa76803cb8d05c105ba219b /engine/handlers
parente7d64510ebd823f186282e2b80780295bcca1b79 (diff)
parent68e4829ac0959d86c651e7ed6dc255c39694c8af (diff)
downloadelgg-cc544cfa2086e418318a899ffd550adfb744c7ba.tar.gz
elgg-cc544cfa2086e418318a899ffd550adfb744c7ba.tar.bz2
Merge Elgg 1.8.3.
Diffstat (limited to 'engine/handlers')
-rw-r--r--engine/handlers/cache_handler.php21
-rw-r--r--engine/handlers/export_handler.php6
2 files changed, 17 insertions, 10 deletions
diff --git a/engine/handlers/cache_handler.php b/engine/handlers/cache_handler.php
index 94a0e64e9..b332ec379 100644
--- a/engine/handlers/cache_handler.php
+++ b/engine/handlers/cache_handler.php
@@ -60,26 +60,31 @@ preg_match($regex, $request, $matches);
$type = $matches[1];
$viewtype = $matches[2];
$view = $matches[3];
+$ts = $matches[4];
+
+// If is the same ETag, content didn't changed.
+$etag = $ts;
+if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && trim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag) {
+ header("HTTP/1.1 304 Not Modified");
+ exit;
+}
switch ($type) {
case 'css':
header("Content-type: text/css", true);
- header('Expires: ' . date('r', strtotime("+6 months")), true);
- header("Pragma: public", true);
- header("Cache-Control: public", true);
-
$view = "css/$view";
break;
case 'js':
header('Content-type: text/javascript', true);
- header('Expires: ' . date('r', strtotime("+6 months")), true);
- header("Pragma: public", true);
- header("Cache-Control: public", true);
-
$view = "js/$view";
break;
}
+header('Expires: ' . date('r', strtotime("+6 months")), true);
+header("Pragma: public", true);
+header("Cache-Control: public", true);
+header("ETag: $etag");
+
$filename = $dataroot . 'views_simplecache/' . md5($viewtype . $view);
if (file_exists($filename)) {
diff --git a/engine/handlers/export_handler.php b/engine/handlers/export_handler.php
index b91a037e8..aa5214c23 100644
--- a/engine/handlers/export_handler.php
+++ b/engine/handlers/export_handler.php
@@ -72,8 +72,10 @@ if (($guid != "") && ($type == "") && ($id_or_name == "")) {
$r = get_relationship($id_or_name);
break;
case 'volatile' :
- $m = elgg_trigger_plugin_hook('volatile', 'metadata',
- array('guid' => $guid, 'varname' => $id_or_name));
+ $m = elgg_trigger_plugin_hook('volatile', 'metadata', array(
+ 'guid' => $guid,
+ 'varname' => $id_or_name,
+ ));
break;
default :