[imp] Slow Loading Of Mailbox With Previews Enabled
Webmaster Extraordinaire
webmasterextraordinaire at yahoo.com
Tue Aug 11 21:36:25 UTC 2009
Hi everyone,
I've been struggling with very slow mailbox load times with previews enabled. I had a specific example using Horde 3.1.1 where it was fine and Horde 3.3.4 where it would take 30 seconds or longer to load the mailbox. There have been other threads and tickets opened on this. Anyways, I finally tracked the problem down and implemented a fix that seems to work.
In /imp/lib/IMAP/MessageCache.php there is the following section of code:
if (String::length($ptext) > $maxlen) {
$ptext = String::substr($ptext, 0, $maxlen) . ' ...';
$cut = true;
}
Changing the code to
if (strlen($ptext) > $maxlen)
{
$ptext = substr($ptext, 0, $maxlen);
$cut = true;
}
solved the problem.
It took me a ridiculously long time to find this. I must have looked at this code a dozen times before finally deciding to start commenting out sections until it worked.
Hopefully this saves someone else some time.
Erik
More information about the imp
mailing list