mirror of
https://github.com/arthurfiorette/axios-cache-interceptor.git
synced 2025-12-08 17:36:16 +00:00
feat: better override documentation
This commit is contained in:
parent
268fccb935
commit
338c9a6888
@ -160,3 +160,15 @@ Possible types:
|
||||
- `number` -> the max time (in seconds) that the cache can be reused.
|
||||
- `boolean` -> `false` disables and `true` enables with infinite time.
|
||||
- `function` -> a predicate that can return `number` or `boolean` as described above.
|
||||
|
||||
## `cache.override`
|
||||
|
||||
This options causes the interceptors bypass the current cache and always make a new http
|
||||
request. This will not delete the current cache, it will just replace the cache when the
|
||||
response arrives.
|
||||
|
||||
Unlike from `cache: false`, this will not disable the cache, it will just ignore the cache
|
||||
checks before making the request. This way, all options are still available and will work
|
||||
as expected.
|
||||
|
||||
Default: `false`
|
||||
|
||||
10
src/cache/cache.ts
vendored
10
src/cache/cache.ts
vendored
@ -111,9 +111,13 @@ export type CacheProperties<R = unknown, D = unknown> = {
|
||||
staleIfError: StaleIfErrorPredicate<R, D>;
|
||||
|
||||
/**
|
||||
* This options makes the interceptors ignore the available cache and always make a new
|
||||
* request. But, different from `cache: false`, this will not delete the current cache
|
||||
* and will update the cache when the request is successful.
|
||||
* This options causes the interceptors bypass the current cache and always make a new
|
||||
* http request. This will not delete the current cache, it will just replace the cache
|
||||
* when the response arrives.
|
||||
*
|
||||
* Unlike from `cache: false`, this will not disable the cache, it will just ignore the
|
||||
* cache checks before making the request. This way, all options are still available and
|
||||
* will work as expected.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user