Caching based on the return value of cachedFunction #3000
Unanswered
jelmerdemaat
asked this question in
Q&A
Replies: 1 comment 8 replies
-
You might try with export const cachedGHStars = defineCachedFunction(
async (repo: string) => {
// ...
},
{
validate(entry) {
return entry.value > 50;
}
}
); BTW please notice that this method, still costs API calls + cache read MISS for small star counts, I think probably it is best to avoid partially invalidating some responses. |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the feature
Hi! Is it possible to do something like this?
So I would like to decide to cache (true or false) inside the
defineCachedFunction
function, based on the return status / value.Additional information
Beta Was this translation helpful? Give feedback.
All reactions