cache notice and user counts in sitemap index
This commit is contained in:
parent
5ff9c0242b
commit
e363b724b9
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user