fgb-vt - v1.0.6
    Preparing search index...

    Interface HttpConnectorOptions

    Configuration options for HttpConnector.

    interface HttpConnectorOptions {
        cacheNamespace?: string;
        coalesceGap?: number;
        conditionalRequests?: boolean;
        headers?: Record<string, string>;
        maxConcurrency?: number;
        prefetch?: number;
        retry?: { attempts: number; backoff: number };
        timeout?: number;
    }
    Index
    cacheNamespace?: string

    Cache namespace (see Connector.cacheNamespace). Defaults to http, or, with headers, to http: plus a hash of them: headers such as Authorization may select different content at the same URL, so connectors with different headers do not share cache entries. Set it to share entries anyway, e.g. across rotating tokens for the same files.

    coalesceGap?: number

    Merge byte ranges separated by at most this many bytes into one request.

    65536 (64 KiB)
    
    conditionalRequests?: boolean

    How reads are bound to the file version seen when the source was opened (its ETag, or Last-Modified without one).

    By default every response's validator is compared with it, and a mismatch raises SourceChangedError. With true, requests also carry If-Match (or If-Unmodified-Since), so the server itself refuses a changed file with 412. Conditional requests have costs: per the Fetch standard they bypass HTTP caches, and in browsers they need a CORS preflight per request.

    false
    
    headers?: Record<string, string>

    Default headers sent with every request.

    Useful for authorization tokens, custom user-agent strings, or CDN-specific headers (e.g. { Authorization: 'Bearer ...' }).

    maxConcurrency?: number

    Most HTTP requests in flight at once across all reads through this connector (every tile and source sharing it); further requests wait in arrival order. Waiting does not count towards timeout.

    Limits parallelism to avoid overwhelming the origin server or exhausting local socket resources. Infinity disables the limit.

    32 in Node.js, 6 in browsers (their per-host connection limit)
    
    prefetch?: number

    Size of the first read of a file (header plus top of the index).

    262144 (256 KiB) in Node.js, 16384 (16 KiB) in browsers
    
    retry?: { attempts: number; backoff: number }

    Retry configuration for transient failures.

    Retries are attempted on HTTP 5xx responses, HTTP 408 and 429, network errors, truncated responses and timeouts. Backoff between attempts grows exponentially (backoff * 2^attempt ms, at most 30 s) with random jitter, so concurrent requests do not retry in lockstep. A server's Retry-After is honoured; if it asks for more than 30 s, the error is raised instead (with ConnectorError.retryAfterMs).

    Type Declaration

    • attempts: number

      Total number of attempts (including the initial request); at least 1.

    • backoff: number

      Base backoff delay in milliseconds before the first retry.

    { attempts: 3, backoff: 200 }
    
    timeout?: number

    Per-attempt timeout in milliseconds, covering the response and its body.

    If an attempt does not complete within this window, it is aborted and (if retries remain) retried. 0 or Infinity disable the timeout.

    30000