Cache all front page stats in APC if available

Use the APC cache to store all of the counts and the recently updated
package list in a cache, which cuts down on the number of database queries
needed. If the data isn't perfectly up to date we will survive.

This version of the patch will also cache the relevant counts for individual
logged-in users and is more careful about checking whether the value
actually exists in the cache by using the status reference to apc_fetch().

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
This commit is contained in:
Dan McGee 2009-01-04 13:43:58 -06:00 committed by Loui Chang
parent 92643bb827
commit 5d6f465170
2 changed files with 38 additions and 20 deletions

View file

@ -6,8 +6,7 @@
</th>
</tr>
<?php while ($row = mysql_fetch_assoc($newest_packages)): ?>
<?php foreach ($newest_packages->getIterator() as $row): ?>
<tr>
<td class="boxSoft">
<span class="f4"><span class="blue">
@ -34,7 +33,7 @@ endif;
</td>
</tr>
<?php endwhile; ?>
<?php endforeach; ?>
</table>