We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 09e5046d authored by Evan Prodromou's avatar Evan Prodromou

cache notice and user counts in sitemap index

parent da8b231d
...@@ -101,7 +101,9 @@ class SitemapindexAction extends Action ...@@ -101,7 +101,9 @@ class SitemapindexAction extends Action
function getUserCounts() function getUserCounts()
{ {
// XXX: cachemeplease $userCounts = User::cacheGet('sitemap:user:counts');
if ($userCounts === false) {
$user = new User(); $user = new User();
...@@ -117,12 +119,17 @@ class SitemapindexAction extends Action ...@@ -117,12 +119,17 @@ class SitemapindexAction extends Action
$userCounts[$user->regdate] = $user->regcount; $userCounts[$user->regdate] = $user->regcount;
} }
User::cacheSet('sitemap:user:counts', $userCounts);
}
return $userCounts; return $userCounts;
} }
function getNoticeCounts() function getNoticeCounts()
{ {
// XXX: cachemeplease $noticeCounts = Notice::cacheGet('sitemap:notice:counts');
if ($noticeCounts === false) {
$notice = new Notice(); $notice = new Notice();
...@@ -138,6 +145,9 @@ class SitemapindexAction extends Action ...@@ -138,6 +145,9 @@ class SitemapindexAction extends Action
$noticeCounts[$notice->postdate] = $notice->postcount; $noticeCounts[$notice->postdate] = $notice->postcount;
} }
Notice::cacheSet('sitemap:notice:counts', $noticeCounts);
}
return $noticeCounts; return $noticeCounts;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment