MyBB Threadcache
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #9
RE: MyBB Threadcache
(03-01-2015 02:20 PM)leefish Wrote:  If I use the forumdisplay hook then the code runs for each thread - which is pointless to have a cache.
You can still have a cache.  You just need to ensure that it's only ever loaded once.  Typical pattern looks something like

PHP Code:
1
2
3
4
5
6
7
8
9
function bleh() {
static $something_cache;
if(!isset($something_cache)) {
  $something_cache = load_cache();
}

$item['value'] = $something_cache[$item['id']]['verifiability'];

}


My Blog
03-01-2015 05:23 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
MyBB Threadcache - leefish - 02-22-2015, 11:54 AM
RE: MyBB Threadcache - ZiNgA BuRgA - 02-23-2015, 04:44 PM
RE: MyBB Threadcache - leefish - 02-25-2015, 02:22 PM
RE: MyBB Threadcache - Sama34 - 02-27-2015, 04:08 PM
RE: MyBB Threadcache - leefish - 02-27-2015, 08:20 PM
RE: MyBB Threadcache - ZiNgA BuRgA - 02-27-2015, 08:37 PM
RE: MyBB Threadcache - Sama34 - 02-28-2015, 04:48 PM
RE: MyBB Threadcache - leefish - 03-01-2015, 02:20 PM
RE: MyBB Threadcache - ZiNgA BuRgA - 03-01-2015 05:23 PM
RE: MyBB Threadcache - Sama34 - 03-02-2015, 06:52 AM

 Standard Tools
Forum Jump: