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

Commit e363b724 authored by Evan Prodromou's avatar Evan Prodromou

cache notice and user counts in sitemap index

parent 5ff9c024
......@@ -101,7 +101,9 @@ class SitemapindexAction extends Action
function getUserCounts()
{
// XXX: cachemeplease
$userCounts = User::cacheGet('sitemap:user:counts');
if ($userCounts === false) {
$user = new User();
......@@ -117,12 +119,17 @@ class SitemapindexAction extends Action
$userCounts[$user->regdate] = $user->regcount;
}
User::cacheSet('sitemap:user:counts', $userCounts);
}
return $userCounts;
}
function getNoticeCounts()
{
// XXX: cachemeplease
$noticeCounts = Notice::cacheGet('sitemap:notice:counts');
if ($noticeCounts === false) {
$notice = new Notice();
......@@ -138,6 +145,9 @@ class SitemapindexAction extends Action
$noticeCounts[$notice->postdate] = $notice->postcount;
}
Notice::cacheSet('sitemap:notice:counts', $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