github.com/Jeffail/benthos/v3@v3.65.0/website/docs/components/caches/ristretto.md (about) 1 --- 2 title: ristretto 3 type: cache 4 status: stable 5 --- 6 7 <!-- 8 THIS FILE IS AUTOGENERATED! 9 10 To make changes please edit the contents of: 11 lib/cache/ristretto.go 12 --> 13 14 import Tabs from '@theme/Tabs'; 15 import TabItem from '@theme/TabItem'; 16 17 18 Stores key/value pairs in a map held in the memory-bound 19 [Ristretto cache](https://github.com/dgraph-io/ristretto). 20 21 22 <Tabs defaultValue="common" values={[ 23 { label: 'Common', value: 'common', }, 24 { label: 'Advanced', value: 'advanced', }, 25 ]}> 26 27 <TabItem value="common"> 28 29 ```yaml 30 # Common config fields, showing default values 31 label: "" 32 ristretto: 33 ttl: "" 34 ``` 35 36 </TabItem> 37 <TabItem value="advanced"> 38 39 ```yaml 40 # All config fields, showing default values 41 label: "" 42 ristretto: 43 ttl: "" 44 retries: 0 45 retry_period: 50ms 46 ``` 47 48 </TabItem> 49 </Tabs> 50 51 This cache is more efficient and appropriate for high-volume use cases than the standard memory cache. However, the add command is non-atomic, and therefore this cache is not suitable for deduplication. 52 53 This cache type supports setting the TTL individually per key by using the 54 dynamic `ttl` field of a cache processor or output in order to 55 override the general TTL configured at the cache resource level. 56 57 ## Fields 58 59 ### `ttl` 60 61 The TTL of each item as a duration string. After this period an item will be eligible for removal during the next compaction. 62 63 64 Type: `string` 65 Default: `""` 66 67 ```yaml 68 # Examples 69 70 ttl: 60s 71 72 ttl: 5m 73 74 ttl: 36h 75 ``` 76 77 ### `retries` 78 79 The maximum number of retry attempts to make before abandoning a request. 80 81 82 Type: `int` 83 Default: `0` 84 85 ### `retry_period` 86 87 The duration to wait between retry attempts. 88 89 90 Type: `string` 91 Default: `"50ms"` 92 93