Skip to content

Commit

Permalink
Cache page content
Browse files Browse the repository at this point in the history
  • Loading branch information
OldStarchy committed Oct 1, 2021
1 parent c8d03ba commit 931b4d4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions code/SeoObjectExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}

0 comments on commit 931b4d4

Please sign in to comment.