PostgresCacheStore
Defined in: src/adapters/postgres.ts:291
Response cache backed by PostgreSQL with base64-encoded body and expiry timestamp.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PostgresCacheStore(
client,table):PostgresCacheStore
Defined in: src/adapters/postgres.ts:292
Parameters
Section titled “Parameters”client
Section titled “client”string
Returns
Section titled “Returns”PostgresCacheStore
Methods
Section titled “Methods”cleanup()
Section titled “cleanup()”cleanup():
Promise<void>
Defined in: src/adapters/postgres.ts:357
Remove expired entries. Call periodically (e.g. via cron or waitUntil).
Returns
Section titled “Returns”Promise<void>
delete()
Section titled “delete()”delete(
key):Promise<boolean>
Defined in: src/adapters/postgres.ts:348
Delete a cached entry. Returns true if something was removed.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”get(
key):Promise<Response|null>
Defined in: src/adapters/postgres.ts:297
Retrieve a cached response by key. Returns null on miss.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<Response | null>
Implementation of
Section titled “Implementation of”put(
key,response,ttlSeconds):Promise<void>
Defined in: src/adapters/postgres.ts:321
Store a response under key with a TTL in seconds.
Parameters
Section titled “Parameters”string
response
Section titled “response”Response
ttlSeconds
Section titled “ttlSeconds”number
Returns
Section titled “Returns”Promise<void>