github.com/Jeffail/benthos/v3@v3.65.0/website/docs/components/caches/about.md (about)

     1  ---
     2  title: Caches
     3  sidebar_label: About
     4  ---
     5  
     6  A cache is a key/value store which can be used by certain components for applications such as deduplication or data joins. Caches are configured as a named resource:
     7  
     8  ```yaml
     9  cache_resources:
    10    - label: foobar
    11      memcached:
    12        addresses:
    13          - localhost:11211
    14        ttl: 60
    15  ```
    16  
    17  > It's possible to layer caches with read-through and write-through behaviour using the [`multilevel` cache][cache.multilevel].
    18  
    19  And then any components that use caches have a field `resource` that specifies the cache resource:
    20  
    21  ```yaml
    22  pipeline:
    23    processors:
    24      - cache:
    25          resource: foobar
    26          operator: add
    27          key: '${! json("message.id") }'
    28          value: "storeme"
    29      - bloblang: root = if errored() { deleted() }
    30  ```
    31  
    32  For the simple case where you wish to store messages in a cache as an output destination for your pipeline check out the [`cache` output][output.cache]. To see examples of more advanced uses of caches such as hydration and deduplication check out the [`cache` processor][processor.cache]. 
    33  
    34  You can find out more about resources [in this document.][config.resources]
    35  
    36  import ComponentSelect from '@theme/ComponentSelect';
    37  
    38  <ComponentSelect type="caches"></ComponentSelect>
    39  
    40  [cache.multilevel]: /docs/components/caches/multilevel
    41  [processor.cache]: /docs/components/processors/cache
    42  [output.cache]: /docs/components/outputs/cache
    43  [config.resources]: /docs/configuration/resources