NeoMutt  2024-04-25-97-g7d2481
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
Email Header Cache

Cache of Email headers.

The Header Cache saves data from email headers to a local store in order to speed up network mailboxes.

See also
store
compress

Operation

When NeoMutt parses an email, it stores the results in a number of structures (listed below). To save time and network traffic, NeoMutt can save the results into a store (optionally using compress).

See also
Address Body Buffer Email Envelope ListNode Parameter

To save the data, the Header Cache uses a set of 'dump' functions (Email-object serialiser) to 'serialise' the structures. The cache also stores a CRC checksum of the C structs that were used. When retrieving the data, the Header Cache uses a set of 'restore' functions to turn the data back into structs.

The CRC checksum is created by hcache/hcachever.sh during the build process. Whenever the definition of any of the structs changes, the CRC will change, invalidating any existing cached data.

Note
Adding or removing a field from the set of serialised fields will not affect the CRC. In this case, it is vital that you bump the **BASEVERSION** variable in hcache/hcachever.sh

Source

File Description
hcache/config.c Config used by Header Cache
hcache/hcache.c Header cache multiplexor
hcache/serialize.c Email-object serialiser

Functions

Function Description Links
hcache_close() Close the connection to the header cache
hcache_delete_email() Delete a key / data pair
hcache_delete_raw() Delete a key / data pair
hcache_fetch_email() Fetch and validate a message's header from the cache
hcache_open() Open the connection to the header cache
hcache_store_email() Store a Header along with a validity datum