I'm definatly not an expert on software caching (I know more about the
basics of hardware caches, but that doesn't do a whole lot of good
here), but it seems like one option would be to cache only the 1st page
of mesages, so the maximum number of cached messages is the number they
show per page (ex: 40), multiplied by the number of folders they have.
Whenever a new message comes in, bump the message that is last on the
list. I know I very rarely go beyond the first page of emails, although
I can't speak for the others.
Just seems like one way to go about it, and it leads to predictable cache sizes, which is useful for planning server loads. Rob
Thomas Bruederli wrote:
Lic. Martin Marques wrote:
What does the messages table exactly store? I'm looking at it's contents and it looks like it puts there good part of the mail headers, plus some other information.
This table is used to store message headers locally for caching purpose. It will only be used if caching is enabled which is not necessary if the IMAP server runs on the same machine.
I'm not sure yet, how to keep this table clean to avoid an exhausting amount of cached messages here. One possibility is to store the message headers just for the current session and remove them when logging out. But for performance issues it would be better to keep the cached messages over multiple sessions...
Other thought was to add a last_view_date which could allow a garbage collection routine to remove headers that haven't been listed over a certain amount of time. The disadvantage of this behavior would be that on every view (SELECT from DB) the last_view_date has to be updated what will cause the database to rewrite it's index and make it slower again.
I'm curious, what you guys think of that problem? Anybody out there experienced with caching mechanisms?
Regards, Thomas
!DSPAM:43a907c652052175210217!