Skip to content

Commit

Permalink
Merge pull request #44 from OldStarchy/2
Browse files Browse the repository at this point in the history
Cache page content
  • Loading branch information
hubertusanton authored Oct 1, 2021
2 parents c8d03ba + 931b4d4 commit 175c554
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 175c554

Please sign in to comment.