diff --git a/src/SeoObjectExtension.php b/src/SeoObjectExtension.php index edf021e..2842e0d 100644 --- a/src/SeoObjectExtension.php +++ b/src/SeoObjectExtension.php @@ -811,16 +811,22 @@ public function getNumCharsTitle() { */ public function getPageContent() { - $session = []; - if (Controller::has_curr()) { - $session = Controller::curr()->getRequest()->getSession(); - } - $response = Director::test($this->owner->Link(), [], $session); + static $cache = null; + + if ($cache === null) { + $session = []; + if (Controller::has_curr()) { + $session = Controller::curr()->getRequest()->getSession(); + } + $response = Director::test($this->owner->Link(), [], $session); - if (!$response->isError()) { - return $response->getBody(); + if (!$response->isError()) { + $cache = $response->getBody(); + } else { + $cache = ''; + } } - - return ''; + + return $cache; } }