public function isCacheableView($view)
{
$view = $this->canonicalizeViewName($view);
if (isset($this->simplecache_views[$view])) {
return true;
}
// build list of viewtypes to check
$current_viewtype = elgg_get_viewtype();
$viewtypes = array($current_viewtype);
if ($this->doesViewtypeFallback($current_viewtype) && $current_viewtype != 'default') {
$viewtypes[] = 'default';
}
// If a static view file is found in any viewtype, it's considered cacheable
foreach ($viewtypes as $viewtype) {
$file = $this->findViewFile($view, $viewtype);
if ($file && pathinfo($file, PATHINFO_EXTENSION) !== 'php') {
$this->simplecache_views[$view] = true;
return true;
}
}
// Assume not-cacheable by default
return false;
}