axios-cache-adapter
axios-cache-adapter copied to clipboard
Does this cache work in a node server? (following #137)
Following this question, I'm calling an external API from my app and it doesn't seem to work.
- Am I doing anything wrong?
- How can I tell if this is working? How many calls are actually going out and how many are read from the cache? Seems to me, from looking around, that I can print the number of calls only if I use localforage as cache.
const SIX_HOURS_IN_MILLIS = 1000 * 60 * 60 * 6
const cache = setupCache({
maxAge: SIX_HOURS_IN_MILLIS
})
const axiosCachedClient = axios.create({
adapter: cache.adapter
})
const response = await axiosCachedClient.get(url)
Thank you!
set debug:true in setupCache.
Which axios version you are using?