something like this:
serve a stale cache between 5-10 seconds, but then update the cache in the background to keep it fresh
const metrics = await cache.getOrSet(
'metrics',
async () => {
return [] // slow call here
},
{
ttl: '5 sec',
swr: '10 sec'
}
)
similar to https://x.com/laravelnews/status/1828542861890965752
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too