Closed futpib closed 3 years ago
I think this could be an option, but not on by default.
Yeah, sounds useful as an opt-in option.
Hello @sindresorhus, I am interested in helping out with this feature. How can I help with it?
@AmrSaber PRs are always welcome
I don't understand how #26 closes this ticket? How do we achieve the stale-while-revalidate scenario now?
Can you show an example of how to achieve this?
False alarm: after the previous PR, I'm not sure how to check if a value is stale anymore to then call the function again.
Should this be reopened then?
Yes, but with the new goal of adding an API to the cache storage object to check whether the object is stale and whether stale-while-revalidate should be used
When used with
maxAge
option, when the cache entry has expired, memoized function could return last cached value while waiting for a new result to arrive.