axios-cache-plugin
Help you cache GET request when using axios.
Install
npm install axios-cache-plugin --save
or
yarn add axios-cache-plugin
Usage
Add cache feature to axios
let http =
or axios instance
let http = axios let httpProxy =
API
By default, axios-cache-plugin
won't cache any GET request unless you add filters.
Filters are Regexps, only the GET request whose url hit the filter reg will be cached.
instance.__addFilter(reg)
example:
let http = http // now the request http://example.com/item/getItemInfoByIdsWithSecKill?param=%7B%22debug_port%22:%22sandbox1%22%7D has been cached
instance.__removeFilter(reg)
Remove filter.
instance.__clearCache()
Clear cache.
wrapper options
Options are optional.
let http =
LICENSE
MIT