Closed Nisthar closed 3 months ago
Axios Cache Interceptor v0 does exports setup cache.
pnpm i axios-cache-interceptor@0
node -e "console.log(require('axios-cache-interceptor'))"
outputs:
Object [Module] {
Header: [Getter],
buildKeyGenerator: [Getter],
buildMemoryStorage: [Getter],
buildStorage: [Getter],
buildWebStorage: [Getter],
canStale: [Getter],
createCacheResponse: [Getter],
createValidateStatus: [Getter],
defaultHeaderInterpreter: [Getter],
defaultKeyGenerator: [Getter],
defaultRequestInterceptor: [Getter],
defaultResponseInterceptor: [Getter],
isExpired: [Getter],
isMethodIn: [Getter],
isStorage: [Getter],
setupCache: [Getter], // <---- HERE
testCachePredicate: [Getter],
updateCache: [Getter],
updateStaleRequest: [Getter]
}
@arthurfiorette This is what i get. I am using version ^0.2.8 since my axios version is 0.21.1
{
StatusCodes: {
CACHED_STATUS_CODE: 304,
CACHED_STATUS_TEXT: '304 Cached by axios-cache-interceptor'
},
applyCache: [Getter],
createCache: [Getter]
}
Oh, you are using a version from 3 years ago. This version is obviously not supported anymore, I'm pretty sure axios 0.21.1 is also not supported as well.
For obviously reasons the documentation for v1 only covers the latest v1 releases and docs for v0 only covers the latest v0 release.
The package has a README bundled with the source code inside your node_modules, you can read it.
What happened?
Docs says to use setupCache from 'axios-cache-interceptor' but there is no setupCache export in v0. is this a typo ?
axios-cache-interceptor version
v0.2
Node / Browser Version
18
Axios Version
0.21
What storage is being used
Memory Storage
Relevant debugging log output