Setu-TS
    Preparing search index...

    Options for configuring the StaticPlugin.

    0.1.0

    type StaticPluginOptions = {
        cacheControl?: string | ((requestPath: string) => string);
        compressed?: boolean;
        etag?: boolean;
        fallback?: string;
        fs?: IFileSystem;
        index?: string;
        maxBufferBytes?: number;
        ranges?: boolean;
        root: string;
        urlPrefix?: string;
    }
    Index
    cacheControl?: string | ((requestPath: string) => string)

    Cache-Control header configuration (default: function returning immutable for hashed assets, must-revalidate for others).

    • A string is used verbatim for all responses.
    • A function is called per request with the FULL leading-slash request path INCLUDING urlPrefix (/assets/app-A9acsx54.js for urlPrefix: '/assets') — a cache policy is about the URL the client caches under, so the served path is the input, never the prefix-stripped server path and never the absolute filesystem path. A directory request delivers its resolved index path, and the path is never the .br/.gz sidecar's, so a hashed asset keeps its policy whichever encoding is negotiated. See CacheControlOptions for the full contract.
    compressed?: boolean

    Enable precompressed sidecar negotiation (default: true).

    etag?: boolean

    Enable ETag generation (default: true).

    fallback?: string

    Fallback file to serve for missing paths when Accept includes text/html (default: undefined). Used for SPA fallback.

    The filesystem to use for file operations.

    index?: string

    Index file to serve when a directory is requested (default: 'index.html'). Set to empty string '' to disable index resolution.

    maxBufferBytes?: number

    Maximum file size to read fully into memory (default: 1MB). Files larger than this will use streaming when available.

    ranges?: boolean

    Enable Range request handling (default: true).

    root: string

    Required. The filesystem directory to serve files from.

    urlPrefix?: string

    URL prefix for static routes (default: '/').