Files
NodeBB/src/posts/cache.js
Opliko 3975fa2e45 fix: return at least one in sizeCalculation (#10832)
if post content is empty post cache should still consider its size to be at least one. fixes #10831
2022-08-15 14:18:43 -04:00

13 lines
287 B
JavaScript

'use strict';
const cacheCreate = require('../cache/lru');
const meta = require('../meta');
module.exports = cacheCreate({
name: 'post',
maxSize: meta.config.postCacheSize,
sizeCalculation: function (n) { return n.length || 1; },
ttl: 0,
enabled: global.env === 'production',
});