Skip to content

arthurfiorette/axios-cache-interceptor

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
February 17, 2023 12:05
February 7, 2023 16:11
February 16, 2023 23:55
May 25, 2023 13:20
February 16, 2023 23:52
January 18, 2022 12:06
February 16, 2023 23:52
February 16, 2023 23:52
February 16, 2023 23:52
May 25, 2023 13:20
February 16, 2023 23:53
May 25, 2023 13:20
May 17, 2023 19:04

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.



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

// Same object, new types.
const axios = setupCache(Axios);

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 for more informations.

FOSSA Status