Zimbra Message Cache
About Zimbra Message Cache:
The uncompressed file cache stores uncompressed versions of blobs on disk. The first time a compressed blob is accessed, we write the uncompressed version to /opt/zimbra/data/tmp/uncompressed. When the file descriptor is closed or aged out of the file descriptor cache, we remove the associated blob from the uncompressed cache. The cache is cleared during server startup and shutdown.
If the size is under MESSAGE_CACHE_DISK_STREAMING_THRESHOLD value (please see the code link above), it tries to read it from local cache. If it does not exist there, it reads from the object store. If the size is above this threshold value, it reads from the object store in either case.
From “getContent” in the upper code, it goes inside https://github.com/Zimbra/zm-mailbox/blob/develop/store/src/java/com/zimbra/cs/store/external/ExternalStoreManager.java to the method below. From there, “readStreamFromStore” method is called. If you had implemented your own object store extension, this will be the code you have written (for coding Zimbra extensions, you can visit my post here) to read mail files from your object store. As you can see, before this method is called, its existence in cache is checked first.
When Zimbra starts up, cache is initialized. For “uncompressed”, max files, max bytes and min lifetime values are set.
The parametric values above are in https://github.com/Zimbra/zm-mailbox/blob/90cf9a8ebe8cd5a09068b2ced1b185f05c9406e5/common/src/java/com/zimbra/common/localconfig/LC.java. These values can be changed with Zimbra config set commands.
https://github.com/Zimbra/zm-mailbox/blob/90cf9a8ebe8cd5a09068b2ced1b185f05c9406e5/common/src/java/com/zimbra/common/util/FileCache.java, FileCache class comment here says: