mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 10:06:13 +01:00
* feat: #8824, cache refactor ability to disable caches ability to download contents of cache refactor cache modules to remove duplicated code * fix: remove duplicate hit/miss tracking check cacheEnabled in getUncachedKeys
This commit is contained in:
committed by
GitHub
parent
bcbc085497
commit
f1f9b225b0
@@ -57,13 +57,12 @@ module.exports = function (Posts) {
|
||||
const cachedContent = cache.get(pid);
|
||||
if (postData.pid && cachedContent !== undefined) {
|
||||
postData.content = cachedContent;
|
||||
cache.hits += 1;
|
||||
return postData;
|
||||
}
|
||||
cache.misses += 1;
|
||||
|
||||
const data = await plugins.fireHook('filter:parse.post', { postData: postData });
|
||||
data.postData.content = translator.escape(data.postData.content);
|
||||
if (global.env === 'production' && data.postData.pid) {
|
||||
if (data.postData.pid) {
|
||||
cache.set(pid, data.postData.content);
|
||||
}
|
||||
return data.postData;
|
||||
|
||||
Reference in New Issue
Block a user