Add possibility to bypass indexes cache only
This commit is contained in:
parent
67f6ef9bbf
commit
be749b2795
2 changed files with 8 additions and 6 deletions
|
@ -35,7 +35,8 @@ $config['kolab_http_request'] = array();
|
|||
|
||||
// When kolab_cache is enabled Roundcube's messages cache will be redundant
|
||||
// when working on kolab folders. Here we can:
|
||||
// 2 - bypass messages/indexes cache completely
|
||||
// 3 - bypass only indexes, but use messages cache
|
||||
// 2 - bypass both messages and indexes cache
|
||||
// 1 - bypass only messages, but use index cache
|
||||
$config['kolab_messages_cache_bypass'] = 0;
|
||||
|
||||
|
|
|
@ -1155,7 +1155,7 @@ class kolab_storage_cache
|
|||
}
|
||||
|
||||
/**
|
||||
* Set Roundcube storage options and bypass messages cache.
|
||||
* Set Roundcube storage options and bypass messages/indexes cache.
|
||||
*
|
||||
* We use skip_deleted and threading settings specific to Kolab,
|
||||
* we have to change these global settings only temporarily.
|
||||
|
@ -1210,17 +1210,18 @@ class kolab_storage_cache
|
|||
|
||||
switch ($cache_bypass) {
|
||||
case 2:
|
||||
// Disable messages cache completely
|
||||
// Disable messages and index cache completely
|
||||
$this->imap->set_messages_caching(!$force);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
case 1:
|
||||
// We'll disable messages cache, but keep index cache.
|
||||
// We'll disable messages cache, but keep index cache (1) or vice-versa (3)
|
||||
// Default mode is both (MODE_INDEX | MODE_MESSAGE)
|
||||
$mode = rcube_imap_cache::MODE_INDEX;
|
||||
$mode = $cache_bypass == 3 ? rcube_imap_cache::MODE_MESSAGE : rcube_imap_cache::MODE_INDEX;
|
||||
|
||||
if (!$force) {
|
||||
$mode |= rcube_imap_cache::MODE_MESSAGE;
|
||||
$mode |= $cache_bypass == 3 ? rcube_imap_cache::MODE_INDEX : rcube_imap_cache::MODE_MESSAGE;
|
||||
}
|
||||
|
||||
$this->imap->set_messages_caching(true, $mode);
|
||||
|
|
Loading…
Add table
Reference in a new issue