Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/arthurfiorette/axios-cache-interceptor

📬 Small and efficient cache interceptor for axios. Etag, Cache-Control, TTL, HTTP headers and more!
https://github.com/arthurfiorette/axios-cache-interceptor

adapter ajax axios axios-cache axios-cache-interceptor axios-plugin axios-react cache cachecontrol etag http interceptor nodejs request ttl web

Last synced: 4 days ago
JSON representation

📬 Small and efficient cache interceptor for axios. Etag, Cache-Control, TTL, HTTP headers and more!

Awesome Lists containing this project

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 it name says, a 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 coding himself a simple and buggy cache system.


[Read the docs to **Learn More**.](https://axios-cache-interceptor.js.org)




```ts
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**. See [`LICENSE`](LICENSE) for more informations.

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Farthurfiorette%2Faxios-cache-interceptor.svg?type=small)](https://app.fossa.com/projects/git%2Bgithub.com%2Farthurfiorette%2Faxios-cache-interceptor?ref=badge_small)