Cache icon

Cache

Caches items

Actions2

Overview

This node provides caching functionality by reading from or writing to a MinIO object storage bucket. It is useful for scenarios where you want to store intermediate data or results temporarily and retrieve them later to avoid redundant processing. For example, you might cache API responses or computationally expensive results to speed up workflows.

In the Read operation, the node attempts to fetch cached items based on specified keys. If the cache is disabled for an item or the cached data does not exist, it passes through the original input item unchanged.

Properties

Name Meaning
Bucket Name The name of the MinIO bucket where cached data is stored or retrieved.
Key One or more keys used to identify cached items uniquely. These keys are hashed internally.
Disabled When enabled, disables caching for that particular item (i.e., skips reading from cache).

Output

  • The output contains two possible main outputs when performing the Read operation:

    • Cache: Items successfully read from the cache, with their JSON content restored.
    • No Cache: Original input items passed through when caching is disabled or no cached data exists.
  • The json field of each output item contains the cached JSON data retrieved from the MinIO bucket.

  • Binary data associated with cached items is not handled in the Read operation (only written during the write operation).

Dependencies

  • Requires access to a MinIO-compatible object storage service.
  • Requires credentials for authenticating with the MinIO service.
  • The node expects the specified bucket to already exist in the MinIO storage.
  • Uses SHA-256 hashing to generate unique cache keys based on the provided key(s).
  • Requires n8n environment configured with appropriate credentials for MinIO.

Troubleshooting

  • Bucket does not exist: The node throws an error if the specified bucket is missing. Ensure the bucket exists before running the node.
  • Error reading item from cache: Could indicate network issues, permission problems, or corrupted cache entries. Check MinIO connectivity and permissions.
  • Disabled property usage: If caching is disabled for an item, the node will pass the original item through without attempting to read from cache.
  • NoSuchKey error: This means the requested cache entry does not exist; the node handles this gracefully by passing the original item to the "No Cache" output.

Links and References

Discussion