#645 위젯 캐싱 설정 시 memcache나 apc에 저장할 수 있도록 개선. revert 로 부터 복구

This commit is contained in:
akasima 2014-05-29 16:07:57 +09:00
parent ddd573949b
commit 64e01dea12

View file

@ -374,6 +374,21 @@ class widgetController extends widget
return $widget_content;
}
$oCacheHandler = CacheHandler::getInstance('template');
if($oCacheHandler->isSupport())
{
$key = 'widget_cache:' . $widget_sequence;
$cache_body = $oCacheHandler->get($key);
$cache_body = preg_replace('@<\!--#Meta:@', '<!--Meta:', $cache_body);
}
if($cache_body)
{
return $cache_body;
}
else
{
/**
* Cache number and cache values are set so that the cache file should call
*/
@ -402,7 +417,15 @@ class widgetController extends widget
$widget_content = $oWidget->proc($args);
$oModuleController = getController('module');
$oModuleController->replaceDefinedLangCode($widget_content);
if($oCacheHandler->isSupport())
{
$oCacheHandler->put($key, $widget_content, $widget_cache * 60);
}
else
{
FileHandler::writeFile($cache_file, $widget_content);
}
}
return $widget_content;
}