Skip to content

PostgresCacheStore

Defined in: src/adapters/postgres.ts:291

Response cache backed by PostgreSQL with base64-encoded body and expiry timestamp.

new PostgresCacheStore(client, table): PostgresCacheStore

Defined in: src/adapters/postgres.ts:292

PostgresClient

string

PostgresCacheStore

cleanup(): Promise<void>

Defined in: src/adapters/postgres.ts:357

Remove expired entries. Call periodically (e.g. via cron or waitUntil).

Promise<void>


delete(key): Promise<boolean>

Defined in: src/adapters/postgres.ts:348

Delete a cached entry. Returns true if something was removed.

string

Promise<boolean>

CacheStore.delete


get(key): Promise<Response | null>

Defined in: src/adapters/postgres.ts:297

Retrieve a cached response by key. Returns null on miss.

string

Promise<Response | null>

CacheStore.get


put(key, response, ttlSeconds): Promise<void>

Defined in: src/adapters/postgres.ts:321

Store a response under key with a TTL in seconds.

string

Response

number

Promise<void>

CacheStore.put