[Dovecot] about index cache
Hi Timo,
Is the dovecot index cache stored only standard header fields (from, to, cc, subject, content-type... )? What happen if there is non standard header, will it be cached?
- Joe
May the force be with you..
On Mon, 2007-08-13 at 19:24 +0800, Joe Wong wrote:
Hi Timo,
Is the dovecot index cache stored only standard header fields (from, to, cc, subject, content-type... )? What happen if there is non standard header, will it be cached?
Yes. Dovecot caches the headers that a client fetches. No more and no less.
Hi Timo,
I see. So, if the client fetch the From field at the first time and then fetch the subject field at the second time, the index.cache file will be updated twice?
- Joe
----- Original Message ----- From: "Timo Sirainen" tss@iki.fi To: "Joe Wong" joewong@tkodog.no-ip.com Cc: dovecot@dovecot.org Sent: Monday, August 13, 2007 7:51 PM Subject: Re: [Dovecot] about index cache
On Mon, 2007-08-13 at 22:22 +0800, Joe Wong wrote:
Hi Timo,
I see. So, if the client fetch the From field at the first time and then fetch the subject field at the second time, the index.cache file will be updated twice?
Not necessarily. It goes like this:
- mailbox is newly created
- a new mail arrives
- Client does FETCH 1 (BODY.PEEK[HEADER.FIELDS (From)]) --> Dovecot caches From header
- Client does FETCH 1 (BODY.PEEK[HEADER.FIELDS (Subject)]) --> Dovecot caches Subject header
- a new mail arrives
- Client does FETCH 1 (BODY.PEEK[HEADER.FIELDS (From)]) --> Dovecot caches From and Subject headers
- Client does FETCH 1 (BODY.PEEK[HEADER.FIELDS (Subject)]) --> Dovecot gets Subject from cache
- a new mail is added with APPEND command or with deliver --> Dovecot caches From and Subject header immediately (v1.1 only)
So Dovecot remembers what fields client is interested of and when header is being parsed it caches everything that it knows the client wants.
Hi Timo,
Not necessarily. It goes like this:
- mailbox is newly created
- a new mail arrives
- Client does FETCH 1 (BODY.PEEK[HEADER.FIELDS (From)]) --> Dovecot caches From header
- Client does FETCH 1 (BODY.PEEK[HEADER.FIELDS (Subject)]) --> Dovecot caches Subject header
- a new mail arrives
- Client does FETCH 1 (BODY.PEEK[HEADER.FIELDS (From)]) --> Dovecot caches From and Subject headers
- Client does FETCH 1 (BODY.PEEK[HEADER.FIELDS (Subject)]) --> Dovecot gets Subject from cache
- a new mail is added with APPEND command or with deliver --> Dovecot caches From and Subject header immediately (v1.1 only)
at 3 and 4, does it means that dovecot has to open the message file twice to get the required header fields from the message? What is the relationship between dovecot.index, dovecot.index.cache and dovecot.index.log?
Thanks for your detailed explaination. :-)
- Joe
----- Original Message ----- From: "Timo Sirainen" tss@iki.fi To: "Joe Wong" joewong@tkodog.no-ip.com Cc: "Dovecot Mailing List" dovecot@dovecot.org Sent: Monday, August 13, 2007 11:06 PM Subject: Re: [Dovecot] about index cache
On Mon, 2007-08-13 at 23:18 +0800, Joe Wong wrote:
Hi Timo,
Not necessarily. It goes like this:
- mailbox is newly created
- a new mail arrives
- Client does FETCH 1 (BODY.PEEK[HEADER.FIELDS (From)]) --> Dovecot caches From header
- Client does FETCH 1 (BODY.PEEK[HEADER.FIELDS (Subject)]) --> Dovecot caches Subject header
- a new mail arrives
- Client does FETCH 1 (BODY.PEEK[HEADER.FIELDS (From)]) --> Dovecot caches From and Subject headers
- Client does FETCH 1 (BODY.PEEK[HEADER.FIELDS (Subject)]) --> Dovecot gets Subject from cache
- a new mail is added with APPEND command or with deliver --> Dovecot caches From and Subject header immediately (v1.1 only)
at 3 and 4, does it means that dovecot has to open the message file twice to get the required header fields from the message?
Yes. But it's only that one time.
What is the relationship between dovecot.index, dovecot.index.cache and dovecot.index.log?
Hi Timo,
Am I right that if the client fetch body.peek[header], no caching of header fields will be done?
Regards,
- joe
On Mon, 13 Aug 2007, Timo Sirainen wrote:
On Mon, 2007-08-13 at 23:18 +0800, Joe Wong wrote:
Hi Timo,
Not necessarily. It goes like this:
- mailbox is newly created
- a new mail arrives
- Client does FETCH 1 (BODY.PEEK[HEADER.FIELDS (From)]) --> Dovecot caches From header
- Client does FETCH 1 (BODY.PEEK[HEADER.FIELDS (Subject)]) --> Dovecot caches Subject header
- a new mail arrives
- Client does FETCH 1 (BODY.PEEK[HEADER.FIELDS (From)]) --> Dovecot caches From and Subject headers
- Client does FETCH 1 (BODY.PEEK[HEADER.FIELDS (Subject)]) --> Dovecot gets Subject from cache
- a new mail is added with APPEND command or with deliver --> Dovecot caches From and Subject header immediately (v1.1 only)
at 3 and 4, does it means that dovecot has to open the message file twice to get the required header fields from the message?
Yes. But it's only that one time.
What is the relationship between dovecot.index, dovecot.index.cache and dovecot.index.log?
--
On Mon, Aug 13, 2007 at 06:06:38PM +0300, Timo Sirainen wrote:
So Dovecot remembers what fields client is interested of and when header is being parsed it caches everything that it knows the client wants.
For how long does dovecot remember which headers? e.g. what happens if a user switches to another mail client which downloads less headers? How long will the now unused headers still be indexed?
Geert
On Mon, 2007-08-13 at 17:23 +0200, Geert Hendrickx wrote:
On Mon, Aug 13, 2007 at 06:06:38PM +0300, Timo Sirainen wrote:
So Dovecot remembers what fields client is interested of and when header is being parsed it caches everything that it knows the client wants.
For how long does dovecot remember which headers? e.g. what happens if a user switches to another mail client which downloads less headers? How long will the now unused headers still be indexed?
From TODO:
- compression should drop fields with last_used <
(latest_mail_index_date - month)
:)
Maybe I should finally implement this for v1.1.
Anyway there is already a difference between permanently cached fields and temporarily cached fields. With most clients (non-webmail, non-Pine) Dovecot uses the temporary rule and the fields get dropped the next time cache is compressed (which usually happens after enough messages are expunged). I should make the compression happen also once in a while to make sure that temporary fields are dropped..
participants (3)
-
Geert Hendrickx
-
Joe Wong
-
Timo Sirainen