diff --git a/code/SeoObjectExtension.php b/code/SeoObjectExtension.php index a3e1f7c..f6c1465 100644 --- a/code/SeoObjectExtension.php +++ b/code/SeoObjectExtension.php @@ -681,12 +681,16 @@ protected function findLayout() { * */ public function getPageContent() { + static $cache = null; - Config::inst()->update('SSViewer', 'theme_enabled', true); - $rendered_layout = $this->RenderLayout(); - Config::inst()->update('SSViewer', 'theme_enabled', false); - return $rendered_layout; + if ($cache === null) { + Config::inst()->update('SSViewer', 'theme_enabled', true); + $rendered_layout = $this->RenderLayout(); + Config::inst()->update('SSViewer', 'theme_enabled', false); + $cache = $rendered_layout; + } + return $cache; } }