Skip to content

SptDB: Cached Query

Demonstrates a query cache layer with TTL that achieves up to 2000x speedup for repeated queries.

Source: examples/sptdb/cached-query.js

Usage

bash
node examples/sptdb/cached-query.js "security patterns" my-namespace

What It Does

  1. Runs a query against SptDB
  2. Caches the result with a configurable TTL
  3. On subsequent identical queries, returns the cached result instantly
  4. Reports cache hit/miss statistics

Released under the MIT License.