An in-memory cache module for Koop, a spatial data server. Version 1.1.0 is the current stable release. It provides a default cache for Koop instances, storing GeoJSON features and their metadata in a JavaScript object. The cache supports insert, update, upsert, delete, retrieve, and streaming operations, with optional TTL expiry. Unlike persistent caches, this is ephemeral and suitable for development or single-process deployments. No breaking changes documented; used primarily as a dependency of the Koop core.
npm install koop-cache-memoryNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Installs and registers the memory cache with a Koop instance, inserts GeoJSON with metadata, and retrieves it.
Use a persistent cache (e.g., koop-cache-redis) for production.
Use upsert to overwrite or delete first.
Use catalog.update to modify metadata after insertion.
Ensure TTL values are provided as seconds (e.g., 3600 for 1 hour).
Use cache.upsert() or call cache.delete(key) before cache.insert().
Register the cache with koop.register(cache) after requiring it.