Save data to the cache.
A plugin should override this to provide specialized caching behavior.
function cache_set($type) {
switch ($type) {
case 'query':
// Not supported currently, but this is certainly where we'd put it.
break;
case 'results':
$data = array(
'result' => $this->view->result,
'total_rows' => isset($this->view->total_rows) ? $this->view->total_rows : 0,
'current_page' => $this->view
->getCurrentPage(),
);
cache($this->table)
->set($this
->generateResultsKey(), $data, $this
->cache_set_expire($type));
break;
case 'output':
$this->storage['output'] = $this->view->display_handler->output;
$this
->gather_headers();
cache($this->table)
->set($this
->generateOutputKey(), $this->storage, $this
->cache_set_expire($type));
break;
}
}