Performance: Skip redundant SELECTs on mail preview and print pages

This commit is contained in:
Aleksander Machniak 2016-02-22 12:26:13 +01:00
parent b6a9141764
commit 4e314fedae
2 changed files with 11 additions and 1 deletions

View file

@ -120,6 +120,10 @@ class kolab_tags extends rcube_plugin
return $args;
}
if ($this->rc->action == 'print') {
return;
}
$this->mail_headers_done = true;
if ($engine = $this->engine()) {

View file

@ -278,6 +278,12 @@ class kolab_tags_engine
public function taglist($attrib)
{
$taglist = $this->backend->list_tags();
// Performance: Save the list for later
if ($this->rc->action == 'show' || $this->rc->action == 'preview') {
$this->taglist = $taglist;
}
$taglist = array_map(array($this, 'parse_tag'), $taglist);
$this->rc->output->set_env('tags', $taglist);
@ -329,7 +335,7 @@ class kolab_tags_engine
*/
public function message_headers_handler($args)
{
$taglist = $this->backend->list_tags();
$taglist = $this->taglist ?: $this->backend->list_tags();
$uid = $args['uid'];
$folder = $args['folder'];
$tags = array();