Changeset 862de1b in github


Ignore:
Timestamp:
Apr 21, 2012 12:28:03 PM (13 months ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo
Children:
6707ca4
Parents:
5a79416
Message:

Revert r6094; Add caching for ACL and Metadata

File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/include/rcube_imap.php

    r5d66a4b r862de1b  
    567567        $mode = strtoupper($mode); 
    568568 
    569         // count search set 
    570         if ($this->search_string && $folder == $this->folder && ($mode == 'ALL' || $mode == 'THREADS') && !$force) { 
     569        // count search set, assume search set is always up-to-date (don't check $force flag) 
     570        if ($this->search_string && $folder == $this->folder && ($mode == 'ALL' || $mode == 'THREADS')) { 
    571571            if ($mode == 'ALL') { 
    572572                return $this->search_set->count_messages(); 
     
    31453145        } 
    31463146 
     3147        // get cached metadata 
     3148        $cache_key = 'mailboxes.folder-info.' . $folder; 
     3149        $cached = $this->get_cache($cache_key); 
     3150 
     3151        if (is_array($cached)) 
     3152            return $cached; 
     3153 
    31473154        $acl       = $this->get_capability('ACL'); 
    31483155        $namespace = $this->get_namespace(); 
     
    32073214        } 
    32083215 
     3216        // update caches 
    32093217        $this->icache['options'] = $options; 
     3218        $this->update_cache($cache_key, $options); 
    32103219 
    32113220        return $options; 
     
    32733282        } 
    32743283 
     3284        $this->clear_cache('mailboxes.folder-info.' . $folder); 
     3285 
    32753286        return $this->conn->setACL($folder, $user, $acl); 
    32763287    } 
     
    33853396            return false; 
    33863397        } 
     3398 
     3399        $this->clear_cache('mailboxes.metadata.' . $folder); 
    33873400 
    33883401        if ($this->get_capability('METADATA') || 
     
    34183431        } 
    34193432 
     3433        $this->clear_cache('mailboxes.metadata.' . $folder); 
     3434 
    34203435        if ($this->get_capability('METADATA') ||  
    34213436            (!strlen($folder) && $this->get_capability('METADATA-SERVER')) 
     
    34513466        } 
    34523467 
     3468        $cache_key = 'mailboxes.metadata.' . $folder; 
     3469        if ($cached = $this->get_cache($cache_key)) 
     3470            return $cached; 
     3471 
    34533472        if ($this->get_capability('METADATA') || 
    34543473            (!strlen($folder) && $this->get_capability('METADATA-SERVER')) 
    34553474        ) { 
    3456             return $this->conn->getMetadata($folder, $entries, $options); 
     3475            $res = $this->conn->getMetadata($folder, $entries, $options); 
     3476            $this->update_cache($cache_key, $res); 
     3477            return $res; 
    34573478        } 
    34583479        else if ($this->get_capability('ANNOTATEMORE') || $this->get_capability('ANNOTATEMORE2')) { 
     
    34733494            } 
    34743495 
     3496            $this->update_cache($cache_key, $res); 
    34753497            return $res; 
    34763498        } 
Note: See TracChangeset for help on using the changeset viewer.