Skip to content

πŸ“¬ Small and efficient cache interceptor for axios. Etag, Cache-Control, TTL, HTTP headers and more!

License

Notifications You must be signed in to change notification settings

arthurfiorette/axios-cache-interceptor

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date
Jan 19, 2024
Nov 16, 2023
Nov 16, 2023
Jan 19, 2024
Dec 12, 2023
Jan 19, 2024
Jan 19, 2024
Jun 30, 2022
Feb 17, 2023
Mar 11, 2022
Feb 17, 2023
Nov 16, 2023
Jan 19, 2024
Dec 25, 2022
Dec 12, 2023
Nov 16, 2023
Jan 19, 2024
Feb 6, 2024
Feb 6, 2024
Jan 19, 2024
Jan 19, 2024

Repository files navigation

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';

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

FOSSA Status