Skip to content

Commit

Permalink
chore(views): Cache assets by viewtype/view, not md5(viewtype/view)
Browse files Browse the repository at this point in the history
Fixes Elgg#8381
  • Loading branch information
ewinslow committed Jun 19, 2015
1 parent 2b431ba commit e7ee012
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions engine/classes/Elgg/Application/CacheHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function handleRequest($path) {
exit;
}

$filename = $config->getVolatile('dataroot') . 'views_simplecache/' . md5("$viewtype|$view");
$filename = $config->getVolatile('dataroot') . "views_simplecache/$viewtype/$view";
if (file_exists($filename)) {
$this->sendCacheHeaders($etag);
readfile($filename);
Expand All @@ -104,9 +104,9 @@ public function handleRequest($path) {

$content = $this->getProcessedView($view, $viewtype);

$dir_name = $config->getDataPath() . 'views_simplecache/';
$dir_name = dirname($filename);
if (!is_dir($dir_name)) {
mkdir($dir_name, 0700);
mkdir($dir_name, 0700, true);
}

file_put_contents($filename, $content);
Expand Down

0 comments on commit e7ee012

Please sign in to comment.