Cache layouts to save two queries per page view

This commit is contained in:
Kijin Sung 2016-04-24 17:21:17 +09:00
parent 85396efcf9
commit 36558f303a
2 changed files with 14 additions and 1 deletions

View file

@ -259,6 +259,7 @@ class layoutAdminController extends layout
$oLayoutModel = getModel('layout');
$cache_file = $oLayoutModel->getUserLayoutCache($args->layout_srl, Context::getLangType());
FileHandler::removeFile($cache_file);
Rhymix\Framework\Cache::delete('layout:' . $args->layout_srl);
}
return $output;
@ -322,10 +323,13 @@ class layoutAdminController extends layout
$layout_file = $oLayoutModel->getUserLayoutHtml($layout_srl);
FileHandler::removeFile($layout_file);
// Delete Layout
$args = new stdClass();
$args->layout_srl = $layout_srl;
$output = executeQuery("layout.deleteLayout", $args);
Rhymix\Framework\Cache::delete('layout:' . $args->layout_srl);
if(!$output->toBool()) return $output;