axios-cache-interceptor

Cache interceptor for axios

axios-cache-interceptor downloads axios-cache-interceptor version axios-cache-interceptor license

axios-cache-interceptor类似的npm包:

npm下载趋势

3 年
🌟 在 axios-cache-interceptor 的 README.md 中显示实时使用量图表,只需复制下面的代码。
## Usage Trend
[![Usage Trend of axios-cache-interceptor](https://npm-compare.com/img/npm-trend/THREE_YEARS/axios-cache-interceptor.png)](https://npm-compare.com/axios-cache-interceptor#timeRange=THREE_YEARS)

Cumulative GitHub Star Trend

🌟 在 axios-cache-interceptor 的 README.md 中显示 GitHub stars 趋势图表,只需复制下面的代码。
## GitHub Stars Trend
[![GitHub Stars Trend of axios-cache-interceptor](https://npm-compare.com/img/github-trend/axios-cache-interceptor.png)](https://npm-compare.com/axios-cache-interceptor)

统计详情

npm包名称
下载量
Stars
大小
Issues
发布时间
License
axios-cache-interceptor180,818817874 kB15 天前MIT

axios-cache-interceptor的README

Using this package? Please consider donating to support my open source work ❤️
Help axios-cache-interceptor grow! Star and share this amazing repository with your friends and co-workers!


Axios Cache Interceptor logo


License Codecov Downloads Bundlephobia Last commit



Axios Cache Interceptor

Cache interceptor for Axios, made with developers and performance in mind.


  • ⚡ Faster!
  • 📦 Handy builds!
  • 🔩 Hassle-free!
  • 🛠️ Rich Features!
  • 🌐 No network waste!
  • 🔑 TypeScript!

Axios Cache Interceptor is, as its name says, an interceptor for axios to handle caching. It was created to help developers call axios multiple times without having to worry about overloading the network or implementing a simple and error-prone cache system.




import Axios from 'axios';
import { setupCache } from 'axios-cache-interceptor';

const instance = Axios.create();
const axios = setupCache(instance);

const req1 = axios.get('https://arthur.place/');
const req2 = axios.get('https://arthur.place/');

const [res1, res2] = await Promise.all([req1, req2]);

res1.cached; // false
res2.cached; // true

License

Licensed under the MIT License. See LICENSE for more information.

FOSSA Status


Star History

Star History Chart

All Thanks to Our Contributors