epicweb-dev / epicweb-dev/cachified
Feature: metadata/status
Open
help wanted
- Dominant language
- TypeScript
- Stars
- 1.1k
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Description
We use cachified in many different contexts in our apps, and we love it.
And we would really love to have the possibility to see cache status from a cache result, in some way or another.
``` typescript
const cachifiedResult = await cachifiedWithMetadata({
key: `user-${userId}`,
cache: ourCache,
async getFreshValue() {
...
},
ttl: 300_000,
});
console.log(cachifiedResult.status) // "HIT", "MISS" or "REVALIDATING"
console.log(cachifiedResult.value) // Cached, or fresh value
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.