epicweb-dev / epicweb-dev/cachified
Performance: support batch-operations on caches
- 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.