WARNING
This documentation is for the v0 axios and axios-cache-interceptor branch
Comparison
This comparison page aims to be detailed, unbiased, and up-to-date.
If you see any information that may be inaccurate or could be improved otherwise, please feel free to suggest changes.
Cache Features
✅ Supported 1st-class and documented.
🔶 Supported and documented, but requires custom user-code to implement.
🟡 Can be done, may not be documented.
🛑 Not officially supported or documented.
Axios Cache Interceptor | Axios Cache Adapter | Cachios | |
---|---|---|---|
Compared version | v0 | 2.7.3 | 3.1.1 |
Expiration with TTL | ✅ | ✅ | ✅ |
Per-request configuration | ✅ | ✅ | ✅ |
Global and custom instance | ✅ | ✅ | ✅ |
Cache-Control header | ✅ | ✅ | 🛑 |
Expires & Age header | ✅ | 🟡 | 🛑 |
ETag and If-None-Match header | ✅ | 🛑 | 🛑 |
If-Modified-Size header | ✅ | 🛑 | 🛑 |
Bundle size | 4.3Kb (gzip) | 18.9Kb (gzip) | 19.5Kb (gzip) |
Typescript declaration | ✅ (Custom interface) | ✅ (Applied globally) | ✅(Applied globally) |
Custom cache keys | ✅ | ✅ | ✅ |
Multiple storages | ✅ | 🔶 (Only localForage) | ✅ |
Built-in redis storage | 🔶 | ✅ | 🟡 |
Handles storage quota errors | ✅ | ✅ | ✅ |
Node & Web compatible | ✅ | ✅ | 🛑 |
Invalidade cache based on response | ✅ | ✅ | 🛑 |
Update cache based on response | ✅ | 🟡 | 🟡 |
Predicate to test if request should be cached | ✅ | ✅ | 🛑 |
Concurrent requests | ✅ | 🔶#231 | 🛑 |
Cache fallback on network errors | ✅ | ✅ | ✅ |
Debug / Development mode | ✅ | ✅ | 🛑 |
Benchmark
There's an simple benchmark in form of a stress test to compare the performance of this library, axios-cache-adapter
and axios as it is.
md
# Result
Run at Fri, 25 Mar 2022 19:32:04 GMT
Commit: 8297fe2201e588f3a8ff69341c6031a7063b55c5
## CACHE INTERCEPTOR
- Operations: 44182/s
- Network requests: 1 of 223037
- Performance: 100.00%
## CACHE ADAPTER
- Operations: 37359/s
- Network requests: 2 of 184213
- Performance: 85%
## AXIOS
- Operations: 1903/s
- Network requests: 9460 of 9460
- Performance: 4%