multilevel
Combines multiple caches as levels, performing read-through and write-through operations across them.
# Config fields, showing default valueslabel: ""multilevel: []
For the Add command this cache first checks all levels except the last for the key. If the key is not found it is added to the final cache level, if that succeeds all higher cache levels have the key set.
Examples​
It's possible to use multilevel to create a warm cache in memory above a cold remote cache:
pipeline:processors:- branch:processors:- cache:resource: leveledoperator: getkey: ${! json("key") }- catch:- bloblang: 'root = {"err":error()}'result_map: 'root.result = this'cache_resources:- label: leveledmultilevel: [ hot, cold ]- label: hotmemory:ttl: 300- label: coldmemcached:addresses: [ TODO:11211 ]ttl: 3600
Using this config when a target key already exists in our local memory cache we won't bother hitting the remote memcached instance.