Magnus Sundberg wrote:
I beleive in automatic addition to the header cache,
1 Start with an empty table of headers_to_cache.
2 Client asks for "From:" and "Subject:" headers
Then add these to the headers_to_cache
Add the headers "From:" and "Subject:" to the header
cache
3 Answer the client with the expected answer.
4 The next client asking for "From:" and "Subject:" headers will get a
very fast answer.
This will take a performance hit on the database when new mail clients
are used. But the database should adapt quite fast.
Remember, one mail client should ask for the same headers each in its
limited sets of queries.
We will this way get an almost optimized database for each site.
With a predetermined set of (static) headers to cache, will we get a
(severe?) performance hit with just one header outside the header
cache on every query.
With the system I have suggested will we probably cache a few headers
to much, but I have no idea of how much this would impair performance.
I don't think this will work well. I think you will wind up with alot
of headers that you don't want, which translates to a lot of unnecesary
work for the mail injectors. 95% of the time you just need the basic
headers, every once in a while you want to search based on non-standard
headers.
<semi-relevant brain storming> I do like the idea of auto selecting the
cached headers, but it needs to be configurable. Perhaps a way to
exclude certain headers from ever being cached, and forcing others to
always be cached. Perhas some type of heuristic, that keeps track of
how often certain headers are being requested, and auto-adding a new
header if requested more than 10% of the time... </semi-relevant brain
storming>