add forum cache toggle
This commit is contained in:
parent
3d1e3d742a
commit
7afdc09dd3
3 changed files with 12 additions and 3 deletions
|
@ -132,12 +132,18 @@ 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);
|
||||
|
||||
if ($cache_enabled) {
|
||||
$this->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creating a new post.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block settingsContent %}
|
||||
<div class="bbcode" id="settingsPreview" style="max-height: 500px; overflow-y: auto; background: #C2AEEE; box-shadow: inset 0 0 1em 1em #D3BFFF;">{{ user.userPage()|raw|nl2br }}</div>
|
||||
<div class="bbcode" id="settingsPreview" style="max-height: 500px; overflow-y: auto; background: #C2AEEE; box-shadow: inset 0 0 1em 1em #D3BFFF;">{{ user.userPage()|raw }}</div>
|
||||
<hr>
|
||||
<form enctype="multipart/form-data" method="post" action="javascript:;" onsubmit="updateSettings(this, '{{ route('settings.account.userpage') }}');">
|
||||
<input type="hidden" name="session" value="{{ session_id() }}">
|
||||
|
|
Reference in a new issue