Some caching improvements

This commit is contained in:
Deon George 2011-05-31 10:42:47 +10:00
parent d29b29fa07
commit 6aabf025ca
4 changed files with 8 additions and 7 deletions

View File

@ -130,7 +130,7 @@ Route::set('default/media', 'media(/<file>)', array('file' => '.+'))
* Set the routes. Each route must have a minimum of a name, a URI and a set of
* defaults for the URI.
*/
Route::set('default', '(<controller>(/<action>(/<id>)))', array('id' => '[a-zA-Z0-9_.]+'))
Route::set('default', '(<controller>(/<action>(/<id>)))', array('id' => '[a-zA-Z0-9_.-]+'))
->defaults(array(
'controller' => 'welcome',
'action' => 'index',

View File

@ -18,7 +18,7 @@ class Controller_NODE extends Controller_TemplateDefault {
$no = ORM::factory('node');
$output = '';
$output .= sprintf(_('This server has <b>%s</b> defined nodes.'),$no->cached(0)->count_all());
$output .= sprintf(_('This server has <b>%s</b> defined nodes.'),$no->count_all());
$output .= '<br/>';
$output .= '<br/>';

View File

@ -25,12 +25,12 @@ class ORMTSM extends ORM {
protected $_formated = FALSE;
protected $_formats = array();
public function __construct($id = NULL) {
parent::__construct($id);
protected function _load_result($multiple = FALSE) {
// We'll cache our query results
if ($c = $this->_db->caching($this->_table_name))
$this->cached($c);
$this->_db_builder->cached($c);
return parent::_load_result($multiple);
}
/**

View File

@ -44,6 +44,7 @@ return array
'CLIENT_SCHEDULES' => 1200,
'CLIENTOPTS' => 1200,
'DEVCLASSES' => 1200,
'DOMAINS' => 1200,
'EVENTS' => 1200,
'FILESPACES' => 1200,
'MGMTCLASSES' => 1200,
@ -51,7 +52,7 @@ return array
'OCCUPANCY' => 1200,
'SCHEMA' => 604800,
'STGPOOLS' => 1200,
'SUMMARY' => 60,
'SUMMARY' => 180,
'VOLUMES' => 1200,
'VOLUMEUSAGE' => 1200,
),