epicweb-dev / epicweb-dev/cachified

Performance: support batch-operations on caches

Open
#10 0 comments 5 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
TypeScript
Stars
1.1k
Forks
30
PR merge metrics
No merged PRs in 30d

Description

When working with batches, some caches could support batch get/set/delete operations. It would probably save bandwidth / time when cachified would support these operations and fall back to parallel single operations when not supported by the cache.

```ts
export interface Cache {
name?: string;
get: (key: string) => Eventually>;
set: (key: string, value: CacheEntry) => unknown | Promise;
delete: (key: string) => unknown | Promise;
batch?: {
get: (keys: string[]) => Eventually[]>;
set: (entries: { key: string, value: CacheEntry }[]) => unknown | Promise;
delete: (keys: string[]) => unknown | Promise;
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.