diff options
| author | Savetheinternet <savetheinternet@tinyboard.org> | 2011-10-07 16:51:19 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@tinyboard.org> | 2011-10-07 16:51:19 +1100 |
| commit | 555688e880b1bb50c13286b7d373ffd683847234 (patch) | |
| tree | 2d6180a889b654a4c775a1879a43de0323dda7a1 /inc/display.php | |
| parent | 160647d196481e41ed2e2558221ff0a068a1f71e (diff) | |
memcached, APC, xcache
Diffstat (limited to 'inc/display.php')
| -rw-r--r-- | inc/display.php | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/inc/display.php b/inc/display.php index 9b2fbe9c..fe33f4c1 100644 --- a/inc/display.php +++ b/inc/display.php @@ -372,26 +372,17 @@ } public function build($index=false) { - global $board, $config, $memcached, $debug; - - if(!$this->mod && $config['memcached']['enabled']) { - if($built = $memcached->get($this->memcached_key($index))) { - if($config['debug']) { - $debug['memcached'][] = $this->memcached_key($index); - } - return $built; - } - } + global $board, $config, $debug; $built = Element('post_thread.html', Array('config' => $config, 'board' => $board, 'post' => &$this, 'index' => $index)); - if(!$this->mod && $config['memcached']['enabled']) { - $memcached->set($this->memcached_key($index), $built, time() + $config['memcached']['timeout']); + if(!$this->mod && $index && $config['cache']['enabled']) { + cache::set($this->cache_key($index), $built); } return $built; } - function memcached_key($index) { + function cache_key($index) { global $board; return 'thread_' . ($index ? 'index_' : '') . $board['uri'] . '_' . $this->id; |
