Skip to content

WIP: Towards LRU attachment cache

As discussed in #453 this is a step towards a LRU attachment disk cache. In this step the duplication of non-inline attachments between the database and filesystem is reduced by keeping only the most recently used 256MB of attachments on the filesystem, and when necessary re-populating that from the database. Later, in another phase, the repopulation to the cache can be updated to happen from the server.

Designed to be merged after !388 (merged) (and branched off that branch).

Things are a little rough here but I also didn't want to put too much into it yet if (as questioned at #453) doing this body of work doesn't make sense.

Potential other remaining TODO:

  • The cache currently works in an ancillary way, another option would be to do some of the work through the cache
  • Indexes on MessageAttachmentTable?
  • Or, retain total attachments size in AttachmentCache?
  • Cleanup approach to supporting older schema versions during migration in ImapDB.Attachment?
  • Present in the UI errors occurring via UI actions
  • Documentation
  • Re-update tests coverage (after sure of no further refactoring)
Edited by Chris Heywood

Merge request reports