cache Plugin

April 7, 2026 ยท View on GitHub

This plugin provides a key-value cache backed by the database. Values can be stored with an optional TTL (time-to-live) in seconds. When a TTL is set, the entry is automatically cleaned up on read (lazy expiration) and at service startup (bulk purge). Setting a TTL of 0 (or omitting it) means the entry never expires.

Configuration

FieldDescription
actionset to store a value, get to retrieve a value, or delete to remove a value
keythe cache key (required for all actions)
valuethe value to store (only used with set; can be any JSON-compatible type: string, number, object, array...)
ttltime-to-live in seconds (only used with set; 0 or omitted means no expiration)

Example

Store a value with a 1-hour TTL:

cache-set:
  action:
    type: cache
    configuration:
      action: set
      key: "my-key"
      value:
        foo: bar
        count: 42
      ttl: 3600

Retrieve the value:

cache-get:
  dependencies:
    - cache-set
  action:
    type: cache
    configuration:
      action: get
      key: "my-key"

Delete the value:

cache-delete:
  dependencies:
    - cache-get
  action:
    type: cache
    configuration:
      action: delete
      key: "my-key"

Requirements

None.

Return

set action output

NameDescription
keythe cache key that was set
cachedtrue if the value was stored

get action output

NameDescription
keythe cache key that was looked up
hittrue if the key was found and not expired, false otherwise
valuethe cached value (or null if hit is false)

delete action output

NameDescription
keythe cache key that was deleted
deletedtrue if the delete was issued