diff --git a/app/Forum/Post.php b/app/Forum/Post.php index f23a74a..af70379 100644 --- a/app/Forum/Post.php +++ b/app/Forum/Post.php @@ -132,9 +132,15 @@ class Post $this->update(); } - if (strlen($this->parsed) < 1) { + $post_parsed = strlen($this->parsed) > 0; + $cache_enabled = config('performance.forum_cache'); + + if (!$cache_enabled || !$post_parsed) { $this->parsed = BBParser::toHTML(htmlentities($this->text), $this->poster); - $this->update(); + + if ($cache_enabled) { + $this->update(); + } } } } diff --git a/config/config.example.ini b/config/config.example.ini index 8b39921..bc90dca 100644 --- a/config/config.example.ini +++ b/config/config.example.ini @@ -70,6 +70,9 @@ cache_dir = store/cache/ ; Enable template caching template_cache = true +; Enable forum caching +forum_cache = true + ; Development specific settings [dev] ; Show detailed error logs in browser diff --git a/resources/views/yuuno/settings/account/userpage.twig b/resources/views/yuuno/settings/account/userpage.twig index 924090a..d51ff21 100644 --- a/resources/views/yuuno/settings/account/userpage.twig +++ b/resources/views/yuuno/settings/account/userpage.twig @@ -7,7 +7,7 @@ {% endblock %} {% block settingsContent %} -
{{ user.userPage()|raw|nl2br }}
+
{{ user.userPage()|raw }}