Comments (7)
Sweet! I'll give this a try soon and report back. Thanks!
from cachified.
Works great 👍 Thank you.
from cachified.
Hi Kent 👋 Sounds useful to me 👍
To be clear: When you say "In the background", you mean a case where the cachified
call returned a stale cache value and getFreshValue
is called in the background to eventually provide a fresh value for the next call right?
from cachified.
Exactly 👍
from cachified.
Could you give [email protected]
a try?
The info is passed on the new GetFreshValueConext
cachified({
/* ... */
ttl: 5,
staleWhileRevalidate: 20,
getFreshValue({ background }) {
console.log(background);
return 'value'
}
});
from cachified.
Glad to hear that! It's released under v3.1.0
from cachified.
Super, thanks a lot :)
from cachified.
Related Issues (20)
- Performance: support batch-operations on caches
- TTL must be slightly longer than the time it takes for the promise to resolve. HOT 16
- redisCacheAdapter does not cache if ttl is set because of the HOT 1
- Article on simple caching: a review/simplification? HOT 3
- Allow me to control the cache time based on the fresh value HOT 6
- Cachified doesn't work with Astro.build HOT 7
- Redis Cache support HOT 9
- Update the example in the docs to use a more "realistic" example HOT 1
- How to deal with missing values with createBatch? HOT 2
- Optionally support zod validators
- Add support for redis-json HOT 4
- Add support for "soft purge" HOT 8
- Make Cache type not use Value HOT 3
- swv? Shouldn't it be swr? HOT 4
- Adding a reporter changes return type of `getFreshValue` to `unknown` HOT 3
- [RFC - New Adapter] Create new Cloudflare KV cache adapter HOT 6
- move into epicweb-dev? HOT 10
- Adapter bug with `swr` set to `Infinity` HOT 1
- Requests are not de-duplicated if there is no `ttl` HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cachified.