| 31 | export type CacheableOptions = (Options & RequestOptions) | string | URL; |
| 32 | |
| 33 | export interface Options { |
| 34 | /** |
| 35 | * If the cache should be used. Setting this to `false` will completely bypass the cache for the current request. |
| 36 | * @default true |
| 37 | */ |
| 38 | cache?: boolean | undefined; |
| 39 | |
| 40 | /** |
| 41 | * If set to `true` once a cached resource has expired it is deleted and will have to be re-requested. |
| 42 | * |
| 43 | * If set to `false`, after a cached resource's TTL expires it is kept in the cache and will be revalidated |
| 44 | * on the next request with `If-None-Match`/`If-Modified-Since` headers. |
| 45 | * @default false |
| 46 | */ |
| 47 | strictTtl?: boolean | undefined; |
| 48 | |
| 49 | /** |
| 50 | * Limits TTL. The `number` represents milliseconds. |
| 51 | * @default undefined |
| 52 | */ |
| 53 | maxTtl?: number | undefined; |
| 54 | |
| 55 | /** |
| 56 | * When set to `true`, if the DB connection fails we will automatically fallback to a network request. |
| 57 | * DB errors will still be emitted to notify you of the problem even though the request callback may succeed. |
| 58 | * @default false |
| 59 | */ |
| 60 | automaticFailover?: boolean | undefined; |
| 61 | |
| 62 | /** |
| 63 | * Forces refreshing the cache. If the response could be retrieved from the cache, it will perform a |
| 64 | * new request and override the cache instead. |
| 65 | * @default false |
| 66 | */ |
| 67 | forceRefresh?: boolean | undefined; |
| 68 | remoteAddress?: boolean | undefined; |
| 69 | |
| 70 | url?: string | undefined; |
| 71 | |
| 72 | headers?: Record<string, string | string[] | undefined>; |
| 73 | |
| 74 | body?: Buffer; |
| 75 | } |
| 76 | |
| 77 | // biome-ignore lint/suspicious/noExplicitAny: type |
| 78 | export interface CacheValue extends Record<string, any> { |
nothing calls this directly
no outgoing calls
no test coverage detected