From 473f11c96b04c5f4d22dcc31c663f26ff34fc655 Mon Sep 17 00:00:00 2001 From: Guilherme Mazoni <40010791+gmazoni@users.noreply.github.com> Date: Fri, 24 Feb 2023 11:38:16 -0300 Subject: [PATCH] docs: added docs for #506 (#509) * Fix #506 * fix fmt * fix docs * fix docs --- docs/src/config/request-specifics.md | 3 ++- src/cache/cache.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/src/config/request-specifics.md b/docs/src/config/request-specifics.md index 4a9ca90..3fec46f 100644 --- a/docs/src/config/request-specifics.md +++ b/docs/src/config/request-specifics.md @@ -308,7 +308,8 @@ const customPredicate = (response, cache, error) => { Types: - `number` -> the max time (in seconds) that the cache can be reused. -- `boolean` -> `false` disables and `true` enables with infinite time. +- `boolean` -> `false` disables and `true` enables with infinite time if no value is + present on `stale-if-error` in Cache-Control. - `function` -> a predicate that can return `number` or `boolean` as described above. ## cache.override diff --git a/src/cache/cache.ts b/src/cache/cache.ts index c98d9b9..4d78ae6 100644 --- a/src/cache/cache.ts +++ b/src/cache/cache.ts @@ -164,7 +164,8 @@ export type CacheProperties = { * Types: * * - `number` -> the max time (in seconds) that the cache can be reused. - * - `boolean` -> `false` disables and `true` enables with infinite time. + * - `boolean` -> `false` disables and `true` enables with infinite time if no value is + * present on `stale-if-error` in Cache-Control. * - `function` -> a predicate that can return `number` or `boolean` as described above. * * @default true