
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
axios-cache-interceptor
Advanced tools
This library is in beta and can have breaking changes until v1.
Not ready for production usage!
axios-cache-interceptor
is a axios wrapper for caching and preventing unneeded requestsimport axios from 'axios';
import { createCache, SessionCacheStorage } from 'axios-cache-interceptor';
// Any custom axios instance
const api = axios.create();
// Other axios instance with caching enabled
const cachedApi = createCache(api, {
// Store values on window.sessionStorage
storage: new SessionCacheStorage(),
// Use the max-age header to determine the cache expiration time
interpretHeader: true
});
// Make a simple request, with caching support, to the api
const { data } = await cachedApi.get('https://api.example.com/');
Axios is a peer dependency and must be installed separately.
# Npm
npm install --save axios axios-cache-interceptor
# Yarn
yarn add axios axios-cache-interceptor
This project is highly inspired by several projects, written entirely in typescript, supporting https headers and much more.
Take a look at some similar projects:
Licensed under the MIT. See LICENSE
for more informations.
See my contact information on my github profile or open a new issue.
v0.2.0 - 2021-09-20
#14
#13
#12
4363f65
f4bbd8b
6075a0a
1f88779
1490bfc
f1033a5
6e61c0d
symbol
38133a7
45630e3
8228045
3ae95cf
FAQs
Cache interceptor for axios
We found that axios-cache-interceptor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.