Type
UrlSourceOptions
Options for UrlSource
.
ts
type UrlSourceOptions = {
requestInit?: RequestInit;
getRetryDelay?: (previousAttempts: number) => number | null;
maxCacheSize?: number;
};
Used by
Properties
requestInit
ts
requestInit?: RequestInit;
The RequestInit
used by the Fetch API. Can be used to further control the requests, such as setting custom headers.
getRetryDelay
ts
getRetryDelay?: ((previousAttempts: number) => number | null);
A function that returns the delay (in seconds) before retrying a failed request. The function is called with the number of previous, unsuccessful attempts. If the function returns null
, no more retries will be made.
By default, it uses an exponential backoff algorithm that never fully gives up.
maxCacheSize
ts
maxCacheSize?: number;
The maximum number of bytes the cache is allowed to hold in memory. Defaults to 64 MiB.