kumo.set_lruttl_cache_capacity(NAME, CAPACITY)
Since: Version 2025.03.19-1d3f1f67
The functionality described in this section requires version 2025.03.19-1d3f1f67 of KumoMTA, or a more recent version.
Allows you to configure the maximum capacity for a specific named pre-defined cache.
You may only update the capacity for caches defined inside kumomta's Rust code
via declare_cache!
. Other caches are assumed to be dynamically created and
expose their capacity as part of their own individual configuration.
kumo.on('pre_init', function()
-- Increase the mx cache size from its default of 64*1024 to 128,000
kumo.set_lruttl_cache_capacity('dns_resolver_mx', 128000)
end)
Note
This function is intended to be used in pre_init
, but it can be called
at any time. Reducing the capacity while the cache holds data will trigger
a partial eviction. The cache will eventually shrink to conform to the
new size as the cache is operated upon and background processing trims
the cache.