Revalidate request in the background, after returning the response #640
-
Hello, I need to return old (stale) data and revalidate it in the background after I return the data. thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Please use hydrate: https://axios-cache-interceptor.js.org/config/request-specifics#cache-hydrate Else, you can just create another call to axios.get() without await, which will revalidate in the background. Automatic support for this feature is planned to be implemented but have some architectural problems, as we cannot resolve a request and still call its adapters. |
Beta Was this translation helpful? Give feedback.
-
For future ref, this twitter thread my help: |
Beta Was this translation helpful? Give feedback.
For future ref, this twitter thread my help:
https://twitter.com/adamdehaven/status/1733228594313277608