On Tue, 2007-08-14 at 08:13 +0200, martin f krafft wrote:
also sprach Timo Sirainen <tss@iki.fi> [2007.08.14.0028 +0200]:
What exactly do you mean by FETCHing metadata? Something like ENVELOPE or BODYSTRUCTURE? And this is fetched for all messages instead of just new ones? That could easily explain why cache is so large.
The code is:
response = imapobj.fetch('1:%d' % maxmsgid, '(FLAGS UID INTERNALDATE)')[1]
meaning that it obtains (FLAGS UID INTERNALDATE) for all messages in a folder every time.
FLAGS and UID are stored in dovecot.index file, and caching only INTERNALDATE would take maybe 16 bytes/message.
So I guess most of the data in your dovecot.index.cache file came from some initial FETCH ENVELOPE/BODYSTRUCTURE/etc. for all messages. If you delete it, it won't probably get as large anymore.
I'm not sure if there's anything I can do on Dovecot's side to make this work better. This shouldn't be a problem except for large mailboxes that are accessed with Dovecot for the first time. There the possibilities are to cache wanted data immediately so that it can be accessed fast the next time, or not cache it at all the first time and if it's needed again doing the whole thing all over again.