Skip to content

Node.js based forum software built for the modern web

closes #6386

Barış Soner Uşaklıb1ccd04ffc43
diff --git a/src/controllers/popular.js b/src/controllers/popular.js
index fae1bbaa16..31976d7808 100644
--- a/src/controllers/popular.js
+++ b/src/controllers/popular.js
@@ -38,8 +38,8 @@ popularController.get = function (req, res, next) {
};
if (!req.loggedIn) {
- if (anonCache[term] && (Date.now() - lastUpdateTime) < 60 * 60 * 1000) {
- return res.render('popular', anonCache[term]);
+ if (anonCache[term] && anonCache[term][page] && (Date.now() - lastUpdateTime) < 60 * 60 * 1000) {
+ return res.render('popular', anonCache[term][page]);
}
}
var settings;
@@ -74,7 +74,8 @@ popularController.get = function (req, res, next) {
}
if (!req.loggedIn) {
- anonCache[term] = data;
+ anonCache[term] = {};
+ anonCache[term][page] = data;
lastUpdateTime = Date.now();
}