cachemate
v2.0.1
Published
Redis-backed caching for Postgres: join/flat/row caching with automatic invalidation via LISTEN/NOTIFY.
Maintainers
Readme
cachemate
Redis-backed caching for Postgres. Join/flat/row caching with automatic invalidation via Postgres LISTEN/NOTIFY.
Homepage · Docs · GitHub · Buy me a coffee
Install
npm install cachemateUsage
import { Client } from "cachemate";
const cache = new Client({
redisUrl: process.env.REDIS_URL,
});
const rows = await cache.withRowsCache({
table: "users",
filters: { id: 1 },
fetch: () => db.query("select * from users where id = $1", [1]),
});Optional Postgres LISTEN/NOTIFY based invalidation:
import { Client } from "cachemate/pg-listen";Full API reference and guides: docs.cachemate.xyz.
License
MIT
