[dev] [cvs] commit: imp/lib Mailbox.php imp/lib/IMAP Cache.php

Michael M Slusarz slusarz at horde.org
Thu Apr 27 22:07:20 PDT 2006


Quoting Michael M Slusarz <slusarz at horde.org>:

> slusarz     2006-04-27 21:51:52 PDT
>
>   Modified files:
>     lib                  Mailbox.php
>     lib/IMAP             Cache.php
>   Log:
>   These changes seems to make caching work much, much better.
>   Search results seem to be working again.
>   We now cache thread objects.
>   We should only rebuild the mailbox list now in the following situations:
>   + first access to mailbox
>   + if mailbox has changed (per imap_status() call)
>   + in message view, only when we reach the last message in list.
>   + for search mailboxes, every mailbox access
>   What are we gaining?  In cases 2 and 3 above, we used to always generate
>   the mailbox list - now we only regenerate if needed.
>   In case 1 above, we used to regenerate every time we switched   
> mailboxes.  now
>   we only regenerate when switching mailboxes if the mailbox has changed.

Thoughts on caching and search mailboxes:
What about entirely caching search results - i.e. a search will result  
in a "snapshot" of message results.  Even if a user does something to  
the results (i.e. delete, change flags) that would normally cause the  
message to disappear from the search results, it will remain.  We  
could then provide a link in the header banner that would allow us to  
"Re-perform search".  Caching search results in this way would be  
*very* useful when doing large searches (i.e. a search on all  
mailboxes).  Personally, I wouldn't mind having this results be  
persistent in exchange for most improved performance - additionally,  
the idea that the search provides a "snapshot" of results is  
consistent with the way other search engines work (i.e. google doesn't  
update results after a page is loaded; windows search does not add  
newly created items to the results list after you have completed  
searching).

Virtual folders would be a separate story.  We would continue to  
re-run the search on every page access - since I expect virtual  
folders to show up-to-date results.  Unfortunately, I can't think of a  
way to reliably provide these results without having to do an IMAP  
search on every mailbox page load in a virtual folder, so we will not  
gain any benefits of caching in virtual folders.  This may just have  
to be the performance price we pay for this feature.  In any case,  
performance is equal to before so we aren't losing anything.

Looking at this from a DIMP perspective, the current status of mailbox  
list caching won't get us much if we are using the trash folder.   
Since deleting a message when using trash will always alter the  
imap_status() signature, we are always going to be regenerating the  
mailbox list.  That being said, we do get performance gains if simply  
viewing messages, especially when switching between mailboxes, since  
these results are now cached and will remain valid until a new message  
appears.

However, we do get massive performance gains if not using trash in  
DIMP since (even if we delete a message) we do not have to regenerate  
either the message list or (if using thread sort) the thread object.

michael

___________________________________
Michael Slusarz [slusarz at horde.org]


More information about the dev mailing list