Copilot 6bda1baae0
Add enabled flag for opt-in cache control (#1141)
* Initial plan

* Add enabled flag to CacheProperties with full implementation and tests

Co-authored-by: arthurfiorette <47537704+arthurfiorette@users.noreply.github.com>

* Fix deprecated annotation to only apply to cache: false, add documentation for enabled flag

Co-authored-by: arthurfiorette <47537704+arthurfiorette@users.noreply.github.com>

* Improve JSDoc comment for DeprecatedFalse type

Co-authored-by: arthurfiorette <47537704+arthurfiorette@users.noreply.github.com>

* Remove deprecation warnings from docs, keep cache: false for backward compatibility

Co-authored-by: arthurfiorette <47537704+arthurfiorette@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: arthurfiorette <47537704+arthurfiorette@users.noreply.github.com>
2025-12-08 12:34:00 -03:00
2023-11-16 03:26:37 -03:00
2025-07-01 21:52:19 -03:00
2023-02-16 23:52:08 -03:00
2024-05-21 13:03:17 -03:00
2024-09-13 10:04:25 -03:00
2025-03-18 00:17:11 -03:00
2022-12-25 17:29:09 -03:00
2025-05-26 11:02:35 -03:00

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.




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


Star History

Star History Chart

All Thanks To Our Contributors:


Description
📬 Small and efficient cache interceptor for axios. Etag, Cache-Contol, TTL, HTTP headers and more!
Readme MIT 67 MiB
Languages
TypeScript 97.2%
JavaScript 1.5%
Shell 1.3%