axios-cache-adapter icon indicating copy to clipboard operation
axios-cache-adapter copied to clipboard

Does this cache work in a node server? (following #137)

Open yaelz opened this issue 5 years ago • 2 comments

Following this question, I'm calling an external API from my app and it doesn't seem to work.

  1. Am I doing anything wrong?
  2. 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!

yaelz avatar Jan 19 '20 06:01 yaelz

set debug:true in setupCache.

gibletto avatar Feb 10 '20 11:02 gibletto

Which axios version you are using?

mohamedgomran avatar Feb 27 '20 16:02 mohamedgomran