Topic: Should caching the forum stats show any visible improvements?
Topic says it all.
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 troubleshooting → Should caching the forum stats show any visible improvements?
Topic says it all.
Which stats?
I would assume that orlandu63 means stuff like names, moderators, descriptions, last posts, topic counts, and post counts. The first and third items could be cached when settings change in the admin area, the second could be updated in the admin section of the profile when changed, and the latter three could be updated upon the creation of a post. If so, this would probably belong in feature requests, but I'll wait to see what orlandu63 says before I move this topic.
Yes, that and the 'stuff'(for lack of a better word) are exactly what I meant. But now I've changed my mind - there's no point in caching such dynamic values (like total number of posts) since it changes so rapidly, there will be only a small increase in server load (heck, maybe even an increase with all that disk usage). And if your forum isn't very popular, recalculating the stats won't really affect your others users' experience, if at all. But things like moderators, that have a semi-static value, should be cached.
But the per-forum moderator list is stored in the forums table and is grabbed when we grab the forums, so I'm not sure how that would be implemented.
But the per-forum moderator list is stored in the forums table and is grabbed when we grab the forums, so I'm not sure how that would be implemented.
It's doable though. Make an associative array and store the array of the moderators (serialized or not) as a sub-array. So something like this:
<?php
$moderators = array(
// forum_id => moderators
1 => array('Connorhd', 'Smartys')
)
?>
Might be harder to make a cache file for tho.
Yes, but why? Fetching the data from the database (like we do now) is very fast since it's part of another query we have to run anyway. If fetching the moderators was a separate query, caching it to disk would make sense.
I don't mind the current way
There's plenty of caching being done already, and I don't think that should be done even more. I was just offering a solution.
PunBB Forums → PunBB 1.2 troubleshooting → Should caching the forum stats show any visible improvements?
Powered by PunBB, supported by Informer Technologies, Inc.